Class EnumSegment<E extends Enum<E>>

java.lang.Object
org.refcodes.serial.AbstractPayloadSegment<Enum<E>>
org.refcodes.serial.EnumSegment<E>
Type Parameters:
E - The type of the enumeration.
All Implemented Interfaces:
Serializable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.PayloadAccessor<Enum<E>>, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Enum<E>,PayloadTransmission<Enum<E>>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<Enum<E>>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<Enum<E>>, org.refcodes.mixin.Schemable<SerialSchema>, org.refcodes.mixin.TypeAccessor<E>, PayloadSegment<Enum<E>>, PayloadTransmission<Enum<E>>, Segment, Segment.SegmentMixin, Transmission, Transmission.TransmissionMixin

public class EnumSegment<E extends Enum<E>> extends AbstractPayloadSegment<Enum<E>> implements Segment, org.refcodes.mixin.TypeAccessor<E>
The EnumSegment is an implementation of a Segment carrying an enumeration value as payload.
See Also:
  • Field Details

  • Constructor Details

    • EnumSegment

      public EnumSegment(Class<E> aType, TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aType - the enumeratrion's type
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • EnumSegment

      public EnumSegment(Enum<E> aValue, TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aValue - The payload to be contained by the DoubleArraySection.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • EnumSegment

      public EnumSegment(String aAlias, Class<E> aType, TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this instance.
      aType - the enumeratrion's type
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • EnumSegment

      public EnumSegment(String aAlias, Enum<E> aValue, TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this instance.
      aValue - The payload to be contained by the DoubleArraySection.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • EnumSegment

      public EnumSegment(Class<E> aType)
      Constructs an empty EnumSegment with a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the EnumSegment's value.
      Parameters:
      aType - the enumeratrion's type
    • EnumSegment

      public EnumSegment(Class<E> aType, org.refcodes.numerical.Endianess aEndianess)
      Constructs an empty EnumSegment with the given Endianess.
      Parameters:
      aType - the enumeratrion's type
      aEndianess - The Endianess to be used for payload values.
    • EnumSegment

      public EnumSegment(Enum<E> aValue, org.refcodes.numerical.Endianess aEndianess)
      Constructs a EnumSegment with the given enumeration value (payload) and the given Endianess for the representation of the EnumSegment's value.
      Parameters:
      aValue - The value (payload) to be contained by the EnumSegment.
      aEndianess - The Endianess to be used for payload values.
    • EnumSegment

      public EnumSegment(String aAlias, Class<E> aType)
      Constructs an empty EnumSegment with a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the EnumSegment's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aType - the enumeratrion's type
    • EnumSegment

      public EnumSegment(String aAlias, Class<E> aType, org.refcodes.numerical.Endianess aEndianess)
      Constructs an empty EnumSegment with the given Endianess.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aType - the enumeratrion's type
      aEndianess - The Endianess to be used for payload values.
    • EnumSegment

      public EnumSegment(String aAlias, Enum<E> aValue, org.refcodes.numerical.Endianess aEndianess)
      Constructs a EnumSegment with the given enumeration value (payload) and the given Endianess for the representation of the EnumSegment's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aValue - The value (payload) to be contained by the EnumSegment.
      aEndianess - The Endianess to be used for payload values.
    • EnumSegment

      public EnumSegment(String aAlias, Class<E> aType, Enum<E> aValue, org.refcodes.numerical.Endianess aEndianess)
      Constructs a EnumSegment with the given enumeration value (payload) and the given Endianess for the representation of the EnumSegment's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aType - the enumeration's type
      aValue - The value (payload) to be contained by the EnumSegment.
      aEndianess - The Endianess to be used for payload values.
  • Method Details