Package io.nem.symbol.catapult.builders
Class GlobalKeyValueBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.GlobalKeyValueBuilder
-
- All Implemented Interfaces:
Serializer
public class GlobalKeyValueBuilder extends java.lang.Object implements Serializer
Binary layout for a global key-value
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGlobalKeyValueBuilder(MosaicRestrictionKeyDto key, RestrictionRuleBuilder restrictionRule)Constructor.protectedGlobalKeyValueBuilder(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 GlobalKeyValueBuildercreate(MosaicRestrictionKeyDto key, RestrictionRuleBuilder restrictionRule)Creates an instance of GlobalKeyValueBuilder.MosaicRestrictionKeyDtogetKey()Gets key associated with a restriction rule.RestrictionRuleBuildergetRestrictionRule()Gets restriction rule (the value) associated with a key.intgetSize()Gets the size of the object.static GlobalKeyValueBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of GlobalKeyValueBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
GlobalKeyValueBuilder
protected GlobalKeyValueBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
GlobalKeyValueBuilder
protected GlobalKeyValueBuilder(MosaicRestrictionKeyDto key, RestrictionRuleBuilder restrictionRule)
Constructor.- Parameters:
key- Key associated with a restriction rule.restrictionRule- Restriction rule (the value) associated with a key.
-
-
Method Detail
-
loadFromBinary
public static GlobalKeyValueBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of GlobalKeyValueBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of GlobalKeyValueBuilder.
-
create
public static GlobalKeyValueBuilder create(MosaicRestrictionKeyDto key, RestrictionRuleBuilder restrictionRule)
Creates an instance of GlobalKeyValueBuilder.- Parameters:
key- Key associated with a restriction rule.restrictionRule- Restriction rule (the value) associated with a key.- Returns:
- Instance of GlobalKeyValueBuilder.
-
getKey
public MosaicRestrictionKeyDto getKey()
Gets key associated with a restriction rule.- Returns:
- Key associated with a restriction rule.
-
getRestrictionRule
public RestrictionRuleBuilder getRestrictionRule()
Gets restriction rule (the value) associated with a key.- Returns:
- Restriction rule (the value) associated with a key.
-
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.
-
-