Class AddressKeyValueBuilder

  • All Implemented Interfaces:
    Serializer

    public class AddressKeyValueBuilder
    extends java.lang.Object
    implements Serializer
    Layout for mosaic address restriction key-value pair
    • Constructor Detail

      • AddressKeyValueBuilder

        protected AddressKeyValueBuilder​(java.io.DataInputStream stream)
        Constructor - Creates an object from stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
      • AddressKeyValueBuilder

        protected AddressKeyValueBuilder​(MosaicRestrictionKeyDto key,
                                         long value)
        Constructor.
        Parameters:
        key - Key for value.
        value - Value associated by key.
    • Method Detail

      • loadFromBinary

        public static AddressKeyValueBuilder loadFromBinary​(java.io.DataInputStream stream)
        Creates an instance of AddressKeyValueBuilder from a stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
        Returns:
        Instance of AddressKeyValueBuilder.
      • create

        public static AddressKeyValueBuilder create​(MosaicRestrictionKeyDto key,
                                                    long value)
        Creates an instance of AddressKeyValueBuilder.
        Parameters:
        key - Key for value.
        value - Value associated by key.
        Returns:
        Instance of AddressKeyValueBuilder.
      • getValue

        public long getValue()
        Gets value associated by key.
        Returns:
        Value associated by key.
      • getSize

        public int getSize()
        Gets the size of the object.
        Specified by:
        getSize in interface Serializer
        Returns:
        Size in bytes.
      • serialize

        public byte[] serialize()
        Serializes an object to bytes.
        Specified by:
        serialize in interface Serializer
        Returns:
        Serialized bytes.