Class PropertiesSection

    • Constructor Detail

      • PropertiesSection

        public PropertiesSection​(org.refcodes.properties.Properties aPayload,
                                 TransmissionMetrics aTransmissionMetrics)
        Constructs a PropertiesSection with the given Properties payload being encoded with the given Charset. The properties from the payload are copied into the PropertiesSection. 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:
        aPayload - The payload to be contained by the Section.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • PropertiesSection

        public PropertiesSection​(String aAlias,
                                 org.refcodes.properties.Properties aPayload,
                                 TransmissionMetrics aTransmissionMetrics)
        Constructs a PropertiesSection with the given Properties payload being encoded with the given Charset. The properties from the payload are copied into the PropertiesSection. 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 segment.
        aPayload - The payload to be contained by the Section.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • PropertiesSection

        public PropertiesSection()
        Constructs an empty PropertiesSection using UTF-8 encoding for the payload.
      • PropertiesSection

        public PropertiesSection​(org.refcodes.properties.Properties aPayload)
        Constructs a PropertiesSection with the given Properties payload being UTF-8 encoded. The properties from the payload are copied into the PropertiesSection.
        Parameters:
        aPayload - The payload to be contained by the Section.
      • PropertiesSection

        public PropertiesSection​(Charset aCharset)
        Constructs a PropertiesSection with a payload expected to be encoded with the given Charset.
        Parameters:
        aCharset - The Charset to be used for encoding the String.
      • PropertiesSection

        public PropertiesSection​(org.refcodes.properties.Properties aPayload,
                                 Charset aCharset)
        Constructs a PropertiesSection with the given Properties payload being encoded with the given Charset. The properties from the payload are copied into the PropertiesSection.
        Parameters:
        aPayload - The payload to be contained by the Section.
        aCharset - The Charset to be used for encoding the String.
      • PropertiesSection

        public PropertiesSection​(String aAlias)
        Constructs an empty PropertiesSection using UTF-8 encoding for the payload.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
      • PropertiesSection

        public PropertiesSection​(String aAlias,
                                 org.refcodes.properties.Properties aPayload)
        Constructs a PropertiesSection with the given Properties payload being UTF-8 encoded. The properties from the payload are copied into the PropertiesSection.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aPayload - The payload to be contained by the Section.
      • PropertiesSection

        public PropertiesSection​(String aAlias,
                                 Charset aCharset)
        Constructs a PropertiesSection with a payload expected to be encoded with the given Charset.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aCharset - The Charset to be used for encoding the String.
      • PropertiesSection

        public PropertiesSection​(String aAlias,
                                 org.refcodes.properties.Properties aPayload,
                                 Charset aCharset)
        Constructs a PropertiesSection with the given Properties payload being encoded with the given Charset. The properties from the payload are copied into the PropertiesSection.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aPayload - The payload to be contained by the Section.
        aCharset - The Charset to be used for encoding the String.
    • Method Detail

      • getLength

        public int getLength()
        Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
        Specified by:
        getLength in interface org.refcodes.mixin.LengthAccessor
        Specified by:
        getLength in interface Transmission
        Returns:
        The (overall) length of the Transmission (including any sub-segments).
      • withPayload

        public PropertiesSection withPayload​(org.refcodes.properties.Properties aValue)
        Specified by:
        withPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<org.refcodes.properties.Properties,​PayloadTransmission<org.refcodes.properties.Properties>>
      • 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
        Overrides:
        toSimpleTypeMap in class AbstractPayloadSection<org.refcodes.properties.Properties>
        Returns:
        The SimpleTypeMap representing this Transmission and (if any) its children, with the according aliases forming the paths to the Transmission's values.
      • getEncoding

        public Charset getEncoding()
        Specified by:
        getEncoding in interface org.refcodes.mixin.EncodingAccessor<Charset>