Class HashLockInfoBuilder

  • All Implemented Interfaces:
    Serializer

    public class HashLockInfoBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for hash lock transaction info
    • Constructor Detail

      • HashLockInfoBuilder

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

        protected HashLockInfoBuilder​(KeyDto senderPublicKey,
                                      MosaicBuilder mosaic,
                                      HeightDto endHeight,
                                      LockStatusDto status,
                                      Hash256Dto hash)
        Constructor.
        Parameters:
        senderPublicKey - Sender public key.
        mosaic - Mosaic associated with lock.
        endHeight - Height at which the lock expires.
        status - Flag indicating whether or not the lock was already used.
        hash - Hash.
    • Method Detail

      • loadFromBinary

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

        public static HashLockInfoBuilder create​(KeyDto senderPublicKey,
                                                 MosaicBuilder mosaic,
                                                 HeightDto endHeight,
                                                 LockStatusDto status,
                                                 Hash256Dto hash)
        Creates an instance of HashLockInfoBuilder.
        Parameters:
        senderPublicKey - Sender public key.
        mosaic - Mosaic associated with lock.
        endHeight - Height at which the lock expires.
        status - Flag indicating whether or not the lock was already used.
        hash - Hash.
        Returns:
        Instance of HashLockInfoBuilder.
      • getSenderPublicKey

        public KeyDto getSenderPublicKey()
        Gets sender public key.
        Returns:
        Sender public key.
      • 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.
      • getHash

        public Hash256Dto getHash()
        Gets hash.
        Returns:
        Hash.
      • 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.