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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
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.serial.Section
Section.SectionMixin
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructor fur sub-classes.AbstractPayloadSection
(String aAlias) Constructs an emptySection
to be initialized viaSection.fromTransmission(Sequence, int)
orSection.fromTransmission(Sequence, int, int)
.AbstractPayloadSection
(String aAlias, T aValue) Constructs aSection
instance with the given value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAlias()
int
hashCode()
void
setPayload
(T aValue) org.refcodes.struct.SimpleTypeMap
Returns theSimpleTypeMap
representation of thisTransmission
.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.PayloadAccessor
getPayloadOr
Methods inherited from interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder
withPayload
Methods inherited from interface org.refcodes.mixin.PayloadAccessor.PayloadProperty
letPayload
Methods inherited from interface org.refcodes.serial.Section
fromTransmission, fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom
Methods inherited from interface org.refcodes.serial.Section.SectionMixin
receiveFrom
Methods inherited from interface org.refcodes.serial.Transmission
getLength, toSchema, toSequence, transmitTo, transmitTo
Methods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
Field Details
-
_payload
-
_alias
-
-
Constructor Details
-
AbstractPayloadSection
protected AbstractPayloadSection()Empty constructor fur sub-classes. -
AbstractPayloadSection
Constructs an emptySection
to be initialized viaSection.fromTransmission(Sequence, int)
orSection.fromTransmission(Sequence, int, int)
.- Parameters:
aAlias
- The alias which identifies the content of this segment.
-
AbstractPayloadSection
Constructs aSection
instance with the given value.- Parameters:
aAlias
- The alias which identifies the content of this segment.aValue
- The value (payload) to be contained by theSection
.
-
-
Method Details
-
setPayload
- Specified by:
setPayload
in interfaceorg.refcodes.mixin.PayloadAccessor.PayloadMutator<T>
-
getPayload
- Specified by:
getPayload
in interfaceorg.refcodes.mixin.PayloadAccessor<T>
-
getAlias
- Specified by:
getAlias
in interfaceorg.refcodes.mixin.AliasAccessor
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMap
representation of thisTransmission
. In case this Transmission hasTransmission
children, then the children are queried as well and contained in the resultingSimpleTypeMap
. The aliases of the accordingTransmission
instances represent the resulting path to aTransmission
's final simple type.- Specified by:
toSimpleTypeMap
in interfaceTransmission
- Returns:
- The
SimpleTypeMap
representing thisTransmission
and (if any) its children, with the according aliases forming the paths to theTransmission
's values.
-