Package io.nem.symbol.catapult.builders
Class MosaicMetadataTransactionBodyBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.MosaicMetadataTransactionBodyBuilder
-
- All Implemented Interfaces:
Serializer
public class MosaicMetadataTransactionBodyBuilder extends java.lang.Object implements Serializer
Binary layout for a mosaic metadata transaction
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMosaicMetadataTransactionBodyBuilder(UnresolvedAddressDto targetAddress, long scopedMetadataKey, UnresolvedMosaicIdDto targetMosaicId, short valueSizeDelta, java.nio.ByteBuffer value)Constructor.protectedMosaicMetadataTransactionBodyBuilder(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 MosaicMetadataTransactionBodyBuildercreate(UnresolvedAddressDto targetAddress, long scopedMetadataKey, UnresolvedMosaicIdDto targetMosaicId, short valueSizeDelta, java.nio.ByteBuffer value)Creates an instance of MosaicMetadataTransactionBodyBuilder.longgetScopedMetadataKey()Gets metadata key scoped to source, target and type.intgetSize()Gets the size of the object.UnresolvedAddressDtogetTargetAddress()Gets metadata target address.UnresolvedMosaicIdDtogetTargetMosaicId()Gets target mosaic identifier.java.nio.ByteBuffergetValue()Gets difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).shortgetValueSizeDelta()Gets change in value size in bytes.static MosaicMetadataTransactionBodyBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of MosaicMetadataTransactionBodyBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
MosaicMetadataTransactionBodyBuilder
protected MosaicMetadataTransactionBodyBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
MosaicMetadataTransactionBodyBuilder
protected MosaicMetadataTransactionBodyBuilder(UnresolvedAddressDto targetAddress, long scopedMetadataKey, UnresolvedMosaicIdDto targetMosaicId, short valueSizeDelta, java.nio.ByteBuffer value)
Constructor.- Parameters:
targetAddress- Metadata target address.scopedMetadataKey- Metadata key scoped to source, target and type.targetMosaicId- Target mosaic identifier.valueSizeDelta- Change in value size in bytes.value- Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
-
-
Method Detail
-
loadFromBinary
public static MosaicMetadataTransactionBodyBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of MosaicMetadataTransactionBodyBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of MosaicMetadataTransactionBodyBuilder.
-
create
public static MosaicMetadataTransactionBodyBuilder create(UnresolvedAddressDto targetAddress, long scopedMetadataKey, UnresolvedMosaicIdDto targetMosaicId, short valueSizeDelta, java.nio.ByteBuffer value)
Creates an instance of MosaicMetadataTransactionBodyBuilder.- Parameters:
targetAddress- Metadata target address.scopedMetadataKey- Metadata key scoped to source, target and type.targetMosaicId- Target mosaic identifier.valueSizeDelta- Change in value size in bytes.value- Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).- Returns:
- Instance of MosaicMetadataTransactionBodyBuilder.
-
getTargetAddress
public UnresolvedAddressDto getTargetAddress()
Gets metadata target address.- Returns:
- Metadata target address.
-
getScopedMetadataKey
public long getScopedMetadataKey()
Gets metadata key scoped to source, target and type.- Returns:
- Metadata key scoped to source, target and type.
-
getTargetMosaicId
public UnresolvedMosaicIdDto getTargetMosaicId()
Gets target mosaic identifier.- Returns:
- Target mosaic identifier.
-
getValueSizeDelta
public short getValueSizeDelta()
Gets change in value size in bytes.- Returns:
- Change in value size in bytes.
-
getValue
public java.nio.ByteBuffer getValue()
Gets difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).- Returns:
- Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value).
-
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.
-
-