-
- Type Parameters:
E
- the type of thehandled
events.
- All Known Subinterfaces:
ChangeAwareListEventListener<E>
,ChangeAwareMapEventListener<K,V>
,ChangeAwareObservableEventListener<V>
,ChangeAwareSetEventListener<E>
,CollectionChangeListener<C>
,ContainerChangeListener<C>
,ListChangeListener<E>
,MapChangeListener<K,V>
,ObservableEventListener<V>
,SetChangeListener<E>
,UiAction
,UiActionApply
,UiActionApprove
,UiActionCancel
,UiActionClose
,UiActionConfirm
,UiActionDelete
,UiActionDiscard
,UiActionEdit
,UiActionNavigate
,UiActionNext
,UiActionNo
,UiActionOk
,UiActionOpen
,UiActionPrevious
,UiActionRemove
,UiActionReset
,UiActionSave
,UiActionSearch
,UiActionSubmit
,UiActionYes
,UiClickEventListener
,UiEventListener
,UiFocusEventListener
,UiNavigationEventListener
,UiSelectionEventListener
,UiValueChangeEventListener
,UiVisibilityEventListener
- All Known Implementing Classes:
BidirectionalBinding
,BindingListener
,ObservableEventReceiver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface EventListener<E>
Interface for a generic event listener.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
isMatchedUsingEquals()
void
onEvent(E event)
This method is called if an event occurred.
-
-
-
Method Detail
-
isMatchedUsingEquals
default boolean isMatchedUsingEquals()
- Returns:
true
if to match usingequals
,false
to match via object identity (compared using==
). For better performance the default isfalse
. If you implement this interface as a class overridingequals
in order to being able toremove
theEventListener
without keeping its reference by creating a newequal
EventListener
instance, then you simply need to override this method returningtrue
.
-
onEvent
void onEvent(E event)
This method is called if an event occurred.
WARNING:
Depending on the implementation ofEventSource
it may NOT be legal toadd
orremove
listeners during the call of this method as this may lead to a dead-lock.- Parameters:
event
- is the event that notifies about something that happened.
-
-