Class SecretLockInfoBuilder

  • All Implemented Interfaces:
    Serializer

    public class SecretLockInfoBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for serialized lock transaction
    • Constructor Detail

      • SecretLockInfoBuilder

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

        protected SecretLockInfoBuilder​(AddressDto ownerAddress,
                                        MosaicBuilder mosaic,
                                        HeightDto endHeight,
                                        LockStatusDto status,
                                        LockHashAlgorithmDto hashAlgorithm,
                                        Hash256Dto secret,
                                        AddressDto recipient)
        Constructor.
        Parameters:
        ownerAddress - Owner address.
        mosaic - Mosaic associated with lock.
        endHeight - Height at which the lock expires.
        status - Flag indicating whether or not the lock was already used.
        hashAlgorithm - Hash algorithm.
        secret - Transaction secret.
        recipient - Transaction recipient.
    • Method Detail

      • loadFromBinary

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

        public static SecretLockInfoBuilder create​(AddressDto ownerAddress,
                                                   MosaicBuilder mosaic,
                                                   HeightDto endHeight,
                                                   LockStatusDto status,
                                                   LockHashAlgorithmDto hashAlgorithm,
                                                   Hash256Dto secret,
                                                   AddressDto recipient)
        Creates an instance of SecretLockInfoBuilder.
        Parameters:
        ownerAddress - Owner address.
        mosaic - Mosaic associated with lock.
        endHeight - Height at which the lock expires.
        status - Flag indicating whether or not the lock was already used.
        hashAlgorithm - Hash algorithm.
        secret - Transaction secret.
        recipient - Transaction recipient.
        Returns:
        Instance of SecretLockInfoBuilder.
      • getOwnerAddress

        public AddressDto getOwnerAddress()
        Gets owner address.
        Returns:
        Owner address.
      • getMosaic

        public MosaicBuilder getMosaic()
        Gets mosaic associated with lock.
        Returns:
        Mosaic associated with lock.
      • getEndHeight

        public HeightDto getEndHeight()
        Gets height at which the lock expires.
        Returns:
        Height at which the lock expires.
      • getStatus

        public LockStatusDto getStatus()
        Gets flag indicating whether or not the lock was already used.
        Returns:
        Flag indicating whether or not the lock was already used.
      • getHashAlgorithm

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

        public Hash256Dto getSecret()
        Gets transaction secret.
        Returns:
        Transaction secret.
      • getRecipient

        public AddressDto getRecipient()
        Gets transaction recipient.
        Returns:
        Transaction recipient.
      • 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.