Class OceanusEvent<E extends Enum<E>>
java.lang.Object
io.github.tonywasher.joceanus.oceanus.event.OceanusEvent<E>
- Type Parameters:
E- the event id type
A generic event with action and item variants. For use by non-GUI components, or else GUI
components that do not have these features.
Additionally listener interfaces for the events
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceOceanusEvent.OceanusEventListener<E extends Enum<E>>Interface for event consumers. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOceanusEvent(int pSourceId, E pEventId) Constructor.protectedOceanusEvent(int pSourceId, E pEventId, Object pDetails) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume()Consume the event.Obtain the details.<T> TgetDetails(Class<T> pClazz) Obtain the details.Obtain the eventId.intObtain the sourceId.booleanIs the event consumed?
-
Constructor Details
-
OceanusEvent
Constructor.- Parameters:
pSourceId- the id of the source of the eventpEventId- the event id
-
OceanusEvent
Constructor.- Parameters:
pSourceId- the id of the source of the eventpEventId- the event idpDetails- the details of the event
-
-
Method Details
-
getSourceId
public int getSourceId()Obtain the sourceId.- Returns:
- the sourceId
-
getEventId
Obtain the eventId.- Returns:
- the eventId
-
getDetails
Obtain the details.- Returns:
- the details
-
getDetails
Obtain the details.- Type Parameters:
T- the details class- Parameters:
pClazz- the class of the details- Returns:
- the details
-
isConsumed
public boolean isConsumed()Is the event consumed?- Returns:
- true/false
-
consume
public void consume()Consume the event.
-