Class OceanusEventRegistration<E extends Enum<E>>

java.lang.Object
io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistration<E>
Type Parameters:
E - The event id type

public class OceanusEventRegistration<E extends Enum<E>> extends Object
Registration structure for event listeners.
  • Constructor Details

    • OceanusEventRegistration

      protected OceanusEventRegistration(Integer pMgrId, OceanusEvent.OceanusEventListener<E> pListener)
      Constructor.
      Parameters:
      pMgrId - the manager Id
      pListener - the listener
    • OceanusEventRegistration

      protected OceanusEventRegistration(Integer pMgrId, E pEventId, OceanusEvent.OceanusEventListener<E> pListener)
      Constructor.
      Parameters:
      pMgrId - the manager Id
      pEventId - the eventId to filter on
      pListener - the listener
  • Method Details

    • isRelevant

      public boolean isRelevant(OceanusEvent<E> pEvent)
      Is the event aimed at this registration.
      Parameters:
      pEvent - the event
      Returns:
      true/false
    • getRegId

      protected Integer getRegId()
      Obtain the registration id.
      Returns:
      the id
    • setRegId

      protected void setRegId(Integer pId)
      Set the registration id.
      Parameters:
      pId - the id
    • processEvent

      protected void processEvent(OceanusEvent<E> pEvent)
      Process the relevant event.
      Parameters:
      pEvent - the event.
    • isFiltered

      protected boolean isFiltered(E pEventId)
      Is the event filtered?
      Parameters:
      pEventId - the event Id
      Returns:
      true/false
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object