public interface EventComponent extends Component
Event
,
DefaultEvent
Lifecyclable.State
LIFECYCLABLE_LOGGER
Modifier and Type | Method and Description |
---|---|
default Class<? extends Component> |
getComponentClass()
Returns the Component interface Class this Component implements.
|
<E extends Event> |
notify(E event)
Notifies all listeners for this type of event.
|
<E extends Event> |
on(Class<E> event,
Consumer<E> action)
Listens to a particular type of event.
|
void |
on(DefaultEvent event,
Consumer<DefaultEvent> action)
Listens to a particular type of event.
|
void |
on(UIEvent event,
Consumer<UIEvent> action)
Listens to a particular type of event.
|
void |
onAny(Consumer<Event> action)
Listens to all kind of events.
|
asSoftware, defaultCopy, getSpeedment, isInternal
getState, initialize, isInitialized, isLoaded, isResolved, isStarted, isStopped, load, onInitialize, onLoad, onResolve, onStart, onStop, postStop, preInitialize, preLoad, preResolve, preStart, preStop, resolve, setState, start, stop
default Class<? extends Component> getComponentClass()
Component
getComponentClass
in interface Component
<E extends Event> void notify(E event)
E
- the event typeevent
- the event that happened<E extends Event> void on(Class<E> event, Consumer<E> action)
notify()
method is called.E
- the event implementationevent
- the event type to listen foraction
- the action to callvoid on(DefaultEvent event, Consumer<DefaultEvent> action)
notify()
method is called.event
- the event type to listen foraction
- the action to callvoid on(UIEvent event, Consumer<UIEvent> action)
notify()
method is called.event
- the event type to listen foraction
- the action to callCopyright © 2016 Speedment, Inc.. All rights reserved.