java.lang.Object
org.refcodes.observer.AbstractEvent<SRC>
org.refcodes.serial.ext.observer.SerialEvent<ObservablePayloadTransmission<P>>
org.refcodes.serial.ext.observer.PayloadEvent<P>
Type Parameters:
P - The type of the payload in question.
All Implemented Interfaces:
org.refcodes.mixin.PayloadAccessor<P>, org.refcodes.mixin.SourceAccessor<ObservablePayloadTransmission<P>>, org.refcodes.observer.Event<ObservablePayloadTransmission<P>>

public class PayloadEvent<P> extends SerialEvent<ObservablePayloadTransmission<P>> implements org.refcodes.mixin.PayloadAccessor<P>
The PayloadEvent gets triggered by ObservablePayloadTransmission instances such as the ObservablePayloadSegmentDecorator or the ObservablePayloadSectionDecorator upon a payload being received.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.mixin.PayloadAccessor

    org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P extends Object,B extends org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P,B>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<P extends Object>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<P extends Object>

    Nested classes/interfaces inherited from interface org.refcodes.mixin.SourceAccessor

    org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC extends Object,B extends org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC,B>>, org.refcodes.mixin.SourceAccessor.SourceMutator<SRC extends Object>, org.refcodes.mixin.SourceAccessor.SourceProperty<SRC extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an event with the given source.
  • Method Summary

    Modifier and Type
    Method
    Description

    Methods inherited from class org.refcodes.observer.AbstractEvent

    getSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.refcodes.mixin.PayloadAccessor

    getPayloadOr
  • Constructor Details

    • PayloadEvent

      public PayloadEvent(P aPayload, ObservablePayloadTransmission<P> aSource)
      Constructs an event with the given source.
      Parameters:
      aPayload - The payload to be carried by the event.
      aSource - The source from which this event originated.
  • Method Details

    • getPayload

      public P getPayload()
      Specified by:
      getPayload in interface org.refcodes.mixin.PayloadAccessor<P>