Class AbstractMagicBytesTransmission

    • Constructor Detail

      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              TransmissionMetrics aTransmissionMetrics)
        Constructs an according instance for magic bytes of the given length. 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.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              String aMagicBytes,
                                              TransmissionMetrics aTransmissionMetrics)
        Constructs an according instance for magic bytes of the given length. 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.
        aMagicBytes - The String to be stored by this instance as magic bytes.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              byte[] aMagicBytes,
                                              TransmissionMetrics aTransmissionMetrics)
        Constructs an according instance for magic bytes of the given length. 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.
        aMagicBytes - The bytes to be stored by this instance as magic bytes.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              int aMagicBytesLength)
        Constructs an AbstractMagicBytesTransmission for magic bytes of the given length.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aMagicBytesLength - The length of the magic bytes sequence.
      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              String aMagicBytes,
                                              Charset aCharset)
        Constructs an AbstractMagicBytesTransmission with the according magic bytes (retrieved from the given String).
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aMagicBytes - The String to be stored by this instance as magic bytes.
        aCharset - The Charset to use when converting the String to a byte array.
      • AbstractMagicBytesTransmission

        public AbstractMagicBytesTransmission​(String aAlias,
                                              byte[] aMagicBytes)
        Constructs an AbstractMagicBytesTransmission with the according magic bytes.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aMagicBytes - The magic bytes to be stored by this instance.
    • Method Detail

      • setPayload

        public void setPayload​(byte[] aValue)
        Sets the magic bytes as of setMagicBytes(byte[]).
        Specified by:
        setPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadMutator<byte[]>
      • getAlias

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

        public byte[] getMagicBytes()
        Returns the magic bytes as stored by this instance.
        Specified by:
        getMagicBytes in interface org.refcodes.mixin.MagicBytesAccessor
        Returns:
        The according magic bytes.
      • setMagicBytes

        public void setMagicBytes​(byte[] aMagicBytes)
        Sets the magic bytes to be stored by this instance.
        Specified by:
        setMagicBytes in interface org.refcodes.mixin.MagicBytesAccessor.MagicBytesMutator
        Parameters:
        aMagicBytes - The according magic bytes to store.
      • setMagicBytes

        public void setMagicBytes​(String aMagicBytes,
                                  Charset aCharset)
        Sets the magic bytes from the provided String to be stored by this instance.
        Specified by:
        setMagicBytes in interface org.refcodes.mixin.MagicBytesAccessor.MagicBytesMutator
        Parameters:
        aMagicBytes - The String from which to copy the according magic bytes from.
        aCharset - The Charset to use when converting the String to a byte array.
      • getMagicBytesLength

        public int getMagicBytesLength()
        Retrieves the magic bytes length from the magic bytes magic bytes length property.
        Specified by:
        getMagicBytesLength in interface MagicBytesLengthAccessor
        Returns:
        The magic bytes length stored by the magic bytes magic bytes length property.
      • getPayload

        public byte[] getPayload()
        Returns the magic bytes as of getMagicBytes().
        Specified by:
        getPayload in interface org.refcodes.mixin.PayloadAccessor<byte[]>
      • getEncoding

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

        public int hashCode()
        Overrides:
        hashCode 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.