Package io.nem.symbol.catapult.builders
Class SecretLockInfoBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.SecretLockInfoBuilder
-
- All Implemented Interfaces:
Serializer
public class SecretLockInfoBuilder extends java.lang.Object implements Serializer
Binary layout for serialized lock transaction
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSecretLockInfoBuilder(AddressDto ownerAddress, MosaicBuilder mosaic, HeightDto endHeight, LockStatusDto status, LockHashAlgorithmDto hashAlgorithm, Hash256Dto secret, AddressDto recipient)Constructor.protectedSecretLockInfoBuilder(java.io.DataInputStream stream)Constructor - Creates an object from stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SecretLockInfoBuildercreate(AddressDto ownerAddress, MosaicBuilder mosaic, HeightDto endHeight, LockStatusDto status, LockHashAlgorithmDto hashAlgorithm, Hash256Dto secret, AddressDto recipient)Creates an instance of SecretLockInfoBuilder.HeightDtogetEndHeight()Gets height at which the lock expires.LockHashAlgorithmDtogetHashAlgorithm()Gets hash algorithm.MosaicBuildergetMosaic()Gets mosaic associated with lock.AddressDtogetOwnerAddress()Gets owner address.AddressDtogetRecipient()Gets transaction recipient.Hash256DtogetSecret()Gets transaction secret.intgetSize()Gets the size of the object.LockStatusDtogetStatus()Gets flag indicating whether or not the lock was already used.static SecretLockInfoBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of SecretLockInfoBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
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:
getSizein interfaceSerializer- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-