Class SignalEnvelope<T>

java.lang.Object
me.tamkungz.signals.internal.SignalEnvelope<T>
Type Parameters:
T - payload type
All Implemented Interfaces:
foo.zaaarf.geb.api.IEvent

public final class SignalEnvelope<T> extends Object implements foo.zaaarf.geb.api.IEvent
GEB event that carries one signal payload together with the key it was fired on.

Internal: this is the only event type SignalRouter listens to. It is public because the dispatcher GEB generates for it lives in this package and must be reachable from the bus.

  • Constructor Details

    • SignalEnvelope

      public SignalEnvelope(Class<T> eventType, T value)
      Wraps a payload for the default key of its type.
      Parameters:
      eventType - payload type
      value - payload
    • SignalEnvelope

      public SignalEnvelope(SignalKey<T> key, T value)
      Wraps a payload for the given key.
      Parameters:
      key - key the payload is fired on
      value - payload
  • Method Details

    • key

      public SignalKey<T> key()
      Returns the key the payload is fired on.
      Returns:
      signal key
    • eventType

      public Class<T> eventType()
      Returns the payload type.
      Returns:
      payload class
    • value

      public T value()
      Returns the payload.
      Returns:
      payload value