Package io.nem.symbol.catapult.builders
Class NamespaceMetadataTransactionBodyBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.NamespaceMetadataTransactionBodyBuilder
-
- All Implemented Interfaces:
Serializer
public class NamespaceMetadataTransactionBodyBuilder extends java.lang.Object implements Serializer
Binary layout for a namespace metadata transaction
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNamespaceMetadataTransactionBodyBuilder(KeyDto targetPublicKey, long scopedMetadataKey, NamespaceIdDto targetNamespaceId, short valueSizeDelta, java.nio.ByteBuffer value)Constructor.protectedNamespaceMetadataTransactionBodyBuilder(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 NamespaceMetadataTransactionBodyBuildercreate(KeyDto targetPublicKey, long scopedMetadataKey, NamespaceIdDto targetNamespaceId, short valueSizeDelta, java.nio.ByteBuffer value)Creates an instance of NamespaceMetadataTransactionBodyBuilder.longgetScopedMetadataKey()Gets metadata key scoped to source, target and type.intgetSize()Gets the size of the object.NamespaceIdDtogetTargetNamespaceId()Gets target namespace identifier.KeyDtogetTargetPublicKey()Gets metadata target public key.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 NamespaceMetadataTransactionBodyBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of NamespaceMetadataTransactionBodyBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
NamespaceMetadataTransactionBodyBuilder
protected NamespaceMetadataTransactionBodyBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
NamespaceMetadataTransactionBodyBuilder
protected NamespaceMetadataTransactionBodyBuilder(KeyDto targetPublicKey, long scopedMetadataKey, NamespaceIdDto targetNamespaceId, short valueSizeDelta, java.nio.ByteBuffer value)
Constructor.- Parameters:
targetPublicKey- Metadata target public key.scopedMetadataKey- Metadata key scoped to source, target and type.targetNamespaceId- Target namespace 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 NamespaceMetadataTransactionBodyBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of NamespaceMetadataTransactionBodyBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of NamespaceMetadataTransactionBodyBuilder.
-
create
public static NamespaceMetadataTransactionBodyBuilder create(KeyDto targetPublicKey, long scopedMetadataKey, NamespaceIdDto targetNamespaceId, short valueSizeDelta, java.nio.ByteBuffer value)
Creates an instance of NamespaceMetadataTransactionBodyBuilder.- Parameters:
targetPublicKey- Metadata target public key.scopedMetadataKey- Metadata key scoped to source, target and type.targetNamespaceId- Target namespace 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 NamespaceMetadataTransactionBodyBuilder.
-
getTargetPublicKey
public KeyDto getTargetPublicKey()
Gets metadata target public key.- Returns:
- Metadata target public key.
-
getScopedMetadataKey
public long getScopedMetadataKey()
Gets metadata key scoped to source, target and type.- Returns:
- Metadata key scoped to source, target and type.
-
getTargetNamespaceId
public NamespaceIdDto getTargetNamespaceId()
Gets target namespace identifier.- Returns:
- Target namespace 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.
-
-