Class AccountMetadataTransactionBodyBuilder

  • All Implemented Interfaces:
    Serializer

    public class AccountMetadataTransactionBodyBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for an account metadata transaction
    • Constructor Detail

      • AccountMetadataTransactionBodyBuilder

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

        protected AccountMetadataTransactionBodyBuilder​(KeyDto targetPublicKey,
                                                        long scopedMetadataKey,
                                                        short valueSizeDelta,
                                                        java.nio.ByteBuffer value)
        Constructor.
        Parameters:
        targetPublicKey - Metadata target public key.
        scopedMetadataKey - Metadata key scoped to source, target and type.
        valueSizeDelta - Change in value size in bytes.
        value - Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
    • Method Detail

      • loadFromBinary

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

        public static AccountMetadataTransactionBodyBuilder create​(KeyDto targetPublicKey,
                                                                   long scopedMetadataKey,
                                                                   short valueSizeDelta,
                                                                   java.nio.ByteBuffer value)
        Creates an instance of AccountMetadataTransactionBodyBuilder.
        Parameters:
        targetPublicKey - Metadata target public key.
        scopedMetadataKey - Metadata key scoped to source, target and type.
        valueSizeDelta - Change in value size in bytes.
        value - Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
        Returns:
        Instance of AccountMetadataTransactionBodyBuilder.
      • getTargetPublicKey

        public KeyDto getTargetPublicKey()
        Gets metadata target public key.
        Returns:
        Metadata target public key.
      • getScopedMetadataKey

        public long getScopedMetadataKey()
        Gets metadata key scoped to source, target and type.
        Returns:
        Metadata key scoped to source, target and type.
      • getValueSizeDelta

        public short getValueSizeDelta()
        Gets change in value size in bytes.
        Returns:
        Change in value size in bytes.
      • getValue

        public java.nio.ByteBuffer getValue()
        Gets difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
        Returns:
        Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
      • 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.