Class AbstractPayloadSection<T>

java.lang.Object
org.refcodes.serial.AbstractPayloadSection<T>
Type Parameters:
T - The type of the body's payload.
All Implemented Interfaces:
Serializable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.PayloadAccessor<T>, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<T,PayloadTransmission<T>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<T>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<T>, org.refcodes.mixin.Schemable, PayloadSection<T>, PayloadTransmission<T>, Section, Section.SectionMixin, Transmission, Transmission.TransmissionMixin
Direct Known Subclasses:
BooleanArraySection, ByteArraySection, CharArraySection, CharSection, DoubleArraySection, FileSection, FloatArraySection, IntArraySection, LongArraySection, PropertiesSection, ShortArraySection, StringSection

public abstract class AbstractPayloadSection<T> extends Object implements PayloadSection<T>, Section.SectionMixin
An abstract implementation of a Section with payload.
See Also:
  • Field Details

    • _payload

      protected T _payload
    • _alias

      protected String _alias
  • Constructor Details

    • AbstractPayloadSection

      protected AbstractPayloadSection()
      Empty constructor fur sub-classes.
    • AbstractPayloadSection

      public AbstractPayloadSection(String aAlias)
      Parameters:
      aAlias - The alias which identifies the content of this segment.
    • AbstractPayloadSection

      public AbstractPayloadSection(String aAlias, T aValue)
      Constructs a Section instance with the given value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aValue - The value (payload) to be contained by the Section.
  • Method Details

    • setPayload

      public void setPayload(T aValue)
      Specified by:
      setPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadMutator<T>
    • getPayload

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

      public String getAlias()
      Specified by:
      getAlias in interface org.refcodes.mixin.AliasAccessor
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toSimpleTypeMap

      public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
      Returns the SimpleTypeMap representation of this Transmission. In case this Transmission has Transmission children, then the children are queried as well and contained in the resulting SimpleTypeMap. The aliases of the according Transmission instances represent the resulting path to a Transmission's final simple type.
      Specified by:
      toSimpleTypeMap in interface Transmission
      Returns:
      The SimpleTypeMap representing this Transmission and (if any) its children, with the according aliases forming the paths to the Transmission's values.