Class RestrictionRuleBuilder

  • All Implemented Interfaces:
    Serializer

    public class RestrictionRuleBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout of restriction rule being applied
    • 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:
        getSize in interface Serializer
        Returns:
        Size in bytes.
      • serialize

        public byte[] serialize()
        Serializes an object to bytes.
        Specified by:
        serialize in interface Serializer
        Returns:
        Serialized bytes.