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:
onEventin interfaceEventListener<V>
-
getEvent
- Returns:
- the last
ObservableEventthat has beenreceived. Will benullif nothing received yet.
-
getEventCount
public int getEventCount()- Returns:
- the number of
ObservableEventsreceived.
-