Package io.nem.symbol.catapult.builders
Class SecretLockTransactionBodyBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.SecretLockTransactionBodyBuilder
-
- All Implemented Interfaces:
Serializer
public class SecretLockTransactionBodyBuilder extends java.lang.Object implements Serializer
Binary layout for a secret lock transaction
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSecretLockTransactionBodyBuilder(Hash256Dto secret, UnresolvedMosaicBuilder mosaic, BlockDurationDto duration, LockHashAlgorithmDto hashAlgorithm, UnresolvedAddressDto recipientAddress)Constructor.protectedSecretLockTransactionBodyBuilder(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 SecretLockTransactionBodyBuildercreate(Hash256Dto secret, UnresolvedMosaicBuilder mosaic, BlockDurationDto duration, LockHashAlgorithmDto hashAlgorithm, UnresolvedAddressDto recipientAddress)Creates an instance of SecretLockTransactionBodyBuilder.BlockDurationDtogetDuration()Gets number of blocks for which a lock should be valid.LockHashAlgorithmDtogetHashAlgorithm()Gets hash algorithm.UnresolvedMosaicBuildergetMosaic()Gets locked mosaic.UnresolvedAddressDtogetRecipientAddress()Gets locked mosaic recipient address.Hash256DtogetSecret()Gets secret.intgetSize()Gets the size of the object.static SecretLockTransactionBodyBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of SecretLockTransactionBodyBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
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.
-
create
public static SecretLockTransactionBodyBuilder create(Hash256Dto secret, UnresolvedMosaicBuilder mosaic, BlockDurationDto duration, LockHashAlgorithmDto hashAlgorithm, UnresolvedAddressDto recipientAddress)
Creates an instance of SecretLockTransactionBodyBuilder.- 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.- Returns:
- Instance of SecretLockTransactionBodyBuilder.
-
getSecret
public Hash256Dto getSecret()
Gets secret.- Returns:
- Secret.
-
getMosaic
public UnresolvedMosaicBuilder getMosaic()
Gets locked mosaic.- Returns:
- Locked mosaic.
-
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:
getSizein interfaceSerializer- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-