Package io.nem.symbol.catapult.builders
Class RestrictionRuleBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.RestrictionRuleBuilder
-
- All Implemented Interfaces:
Serializer
public class RestrictionRuleBuilder extends java.lang.Object implements Serializer
Binary layout of restriction rule being applied
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRestrictionRuleBuilder(MosaicIdDto referenceMosaicId, long restrictionValue, MosaicRestrictionTypeDto restrictionType)Constructor.protectedRestrictionRuleBuilder(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 RestrictionRuleBuildercreate(MosaicIdDto referenceMosaicId, long restrictionValue, MosaicRestrictionTypeDto restrictionType)Creates an instance of RestrictionRuleBuilder.MosaicIdDtogetReferenceMosaicId()Gets identifier of the mosaic providing the restriction key.MosaicRestrictionTypeDtogetRestrictionType()Gets restriction type.longgetRestrictionValue()Gets restriction value.intgetSize()Gets the size of the object.static RestrictionRuleBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of RestrictionRuleBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
Constructor Detail
-
RestrictionRuleBuilder
protected RestrictionRuleBuilder(java.io.DataInputStream stream)
Constructor - Creates an object from stream.- Parameters:
stream- Byte stream to use to serialize the object.
-
RestrictionRuleBuilder
protected RestrictionRuleBuilder(MosaicIdDto referenceMosaicId, long restrictionValue, MosaicRestrictionTypeDto restrictionType)
Constructor.- Parameters:
referenceMosaicId- Identifier of the mosaic providing the restriction key.restrictionValue- Restriction value.restrictionType- Restriction type.
-
-
Method Detail
-
loadFromBinary
public static RestrictionRuleBuilder loadFromBinary(java.io.DataInputStream stream)
Creates an instance of RestrictionRuleBuilder from a stream.- Parameters:
stream- Byte stream to use to serialize the object.- Returns:
- Instance of RestrictionRuleBuilder.
-
create
public static RestrictionRuleBuilder create(MosaicIdDto referenceMosaicId, long restrictionValue, MosaicRestrictionTypeDto restrictionType)
Creates an instance of RestrictionRuleBuilder.- Parameters:
referenceMosaicId- Identifier of the mosaic providing the restriction key.restrictionValue- Restriction value.restrictionType- Restriction type.- Returns:
- Instance of RestrictionRuleBuilder.
-
getReferenceMosaicId
public MosaicIdDto getReferenceMosaicId()
Gets identifier of the mosaic providing the restriction key.- Returns:
- Identifier of the mosaic providing the restriction key.
-
getRestrictionValue
public long getRestrictionValue()
Gets restriction value.- Returns:
- Restriction value.
-
getRestrictionType
public MosaicRestrictionTypeDto getRestrictionType()
Gets restriction type.- Returns:
- Restriction type.
-
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.
-
-