Package io.github.mmm.value.observable
Class ObservableEventReceiver<V>
java.lang.Object
io.github.mmm.value.observable.ObservableEventReceiver<V>
- Type Parameters:
V
- type of the value.
- All Implemented Interfaces:
EventListener<ObservableEvent<V>>
,ObservableEventListener<V>
Implementation of
ObservableEventListener
that counts
the
received
events and allows to get the last received event
.
Mainly useful for testing.-
Constructor Details
-
ObservableEventReceiver
public ObservableEventReceiver()The constructor.
-
-
Method Details
-
onEvent
- Specified by:
onEvent
in interfaceEventListener<V>
-
getEvent
- Returns:
- the last
ObservableEvent
that has beenreceived
. Will benull
if nothing received yet.
-
getEventCount
public int getEventCount()- Returns:
- the number of
ObservableEvent
sreceived
.
-