Class AbstractMetaDataActionEvent<A,EM extends org.refcodes.mixin.EventMetaData,SRC>

java.lang.Object
org.refcodes.observer.AbstractEvent<SRC>
org.refcodes.observer.AbstractActionEvent<A,SRC>
org.refcodes.observer.AbstractMetaDataActionEvent<A,EM,SRC>
Type Parameters:
A - The type of the action stored in the event.
EM - The type of the EventMetaData
SRC - The type of the source in question.
All Implemented Interfaces:
org.refcodes.mixin.ActionAccessor<A>, org.refcodes.mixin.MetaDataAccessor<EM>, org.refcodes.mixin.SourceAccessor<SRC>, GenericActionEvent<A,SRC>, GenericActionMetaDataEvent<A,EM,SRC>, GenericEvent<SRC>, GenericMetaDataEvent<EM,SRC>
Direct Known Subclasses:
AbstractMetaDataActionEvent.AbstractActionMetaDataEventBuilder, AbstractPayloadMetaDataActionEvent, MetaDataActionEventImpl

public abstract class AbstractMetaDataActionEvent<A,EM extends org.refcodes.mixin.EventMetaData,SRC> extends AbstractActionEvent<A,SRC> implements GenericActionMetaDataEvent<A,EM,SRC>
Ready to use GenericActionEvent storing a defined set of EventMetaData.

TIPP: In order to distinguish AbstractMetaDataActionEvent instances from each other, create an actions enumeration, enumerating the various event actions you support. Pass the actual action you intend to notify upon to the according constructor, as an Observer you may use the declarative method EventMatcherSugar.actionEqualWith(Object) to test whether your action was notified (or a simple switch case statement).

  • Field Details

    • _eventMetaData

      protected EM extends org.refcodes.mixin.EventMetaData _eventMetaData
  • Constructor Details

    • AbstractMetaDataActionEvent

      public AbstractMetaDataActionEvent(EM aEventMetaData, SRC aSource)
      Constructs an event with the given Meta-Data.
      Parameters:
      aEventMetaData - The Meta-Data to by supplied by the event.
      aSource - The source from which this event originated.
    • AbstractMetaDataActionEvent

      public AbstractMetaDataActionEvent(A aAction, EM aEventMetaData, SRC aSource)
      Constructs an event with the given Meta-Data.
      Parameters:
      aAction - The action which the event represents.
      aEventMetaData - The Meta-Data to by supplied by the event.
      aSource - The source from which this event originated.
    • AbstractMetaDataActionEvent

      public AbstractMetaDataActionEvent(A aAction, SRC aSource)
      Constructs an event with the given Meta-Data.
      Parameters:
      aAction - The action which the event represents.
      aSource - The source from which this event originated.
    • AbstractMetaDataActionEvent

      public AbstractMetaDataActionEvent(SRC aSource)
      Constructs an event with the given Meta-Data.
      Parameters:
      aSource - The source from which this event originated.
  • Method Details

    • getMetaData

      public EM getMetaData()
      Specified by:
      getMetaData in interface org.refcodes.mixin.MetaDataAccessor<A>
    • toString

      public String toString()
      Overrides:
      toString in class Object