use of io.nem.symbol.catapult.builders.LockHashAlgorithmDto in project nem2-sdk-java by nemtech.
the class SecretLockInfo method serialize.
/**
* @return serializes the state of this object.
*/
public byte[] serialize() {
short version = (short) getVersion();
AddressDto ownerAddress = SerializationUtils.toAddressDto(getOwnerAddress());
MosaicBuilder mosaic = MosaicBuilder.create(SerializationUtils.toMosaicIdDto(getMosaicId()), SerializationUtils.toAmount(getAmount()));
HeightDto endHeight = new HeightDto(getEndHeight().longValue());
LockStatusDto status = LockStatusDto.rawValueOf(getStatus().getValue());
Hash256Dto secret = SerializationUtils.toHash256Dto(getSecret());
AddressDto recipient = SerializationUtils.toAddressDto(getRecipientAddress());
LockHashAlgorithmDto hashAlgorithm = LockHashAlgorithmDto.rawValueOf((byte) this.hashAlgorithm.getValue());
return SecretLockInfoBuilder.create(version, ownerAddress, mosaic, endHeight, status, hashAlgorithm, secret, recipient).serialize();
}
Aggregations