Class SecretLockTransactionBodyBuilder

  • All Implemented Interfaces:
    Serializer

    public class SecretLockTransactionBodyBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for a secret lock transaction
    • Constructor Detail

      • SecretLockTransactionBodyBuilder

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

        protected SecretLockTransactionBodyBuilder​(Hash256Dto secret,
                                                   UnresolvedMosaicBuilder mosaic,
                                                   BlockDurationDto duration,
                                                   LockHashAlgorithmDto hashAlgorithm,
                                                   UnresolvedAddressDto recipientAddress)
        Constructor.
        Parameters:
        secret - Secret.
        mosaic - Locked mosaic.
        duration - Number of blocks for which a lock should be valid.
        hashAlgorithm - Hash algorithm.
        recipientAddress - Locked mosaic recipient address.
    • Method Detail

      • loadFromBinary

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

        public Hash256Dto getSecret()
        Gets secret.
        Returns:
        Secret.
      • getDuration

        public BlockDurationDto getDuration()
        Gets number of blocks for which a lock should be valid.
        Returns:
        Number of blocks for which a lock should be valid.
      • getHashAlgorithm

        public LockHashAlgorithmDto getHashAlgorithm()
        Gets hash algorithm.
        Returns:
        Hash algorithm.
      • getRecipientAddress

        public UnresolvedAddressDto getRecipientAddress()
        Gets locked mosaic recipient address.
        Returns:
        Locked mosaic recipient address.
      • 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.