Class MosaicFlags

java.lang.Object
org.symbol.sdk.symbol.models.MosaicFlags
All Implemented Interfaces:

Serializer


public final class MosaicFlags extends Object implements Serializer
  • Field Details

    • NONE

      public static final MosaicFlags NONE
    • SUPPLY_MUTABLE

      public static final MosaicFlags SUPPLY_MUTABLE
    • TRANSFERABLE

      public static final MosaicFlags TRANSFERABLE
    • RESTRICTABLE

      public static final MosaicFlags RESTRICTABLE
    • REVOKABLE

      public static final MosaicFlags REVOKABLE
    • value

      public final int value
  • Constructor Details

    • MosaicFlags

      public MosaicFlags(int value)
      Creates a new MosaicFlags.
      Parameters:

      value - Value.

  • Method Details

    • getValue

      public int getValue()
      MosaicFlags.getValue

      Gets the value field.

      Returns:

      The value field.

    • fromValue

      public static MosaicFlags fromValue(int value)
      MosaicFlags.fromValue

      Creates an instance from its underlying numeric value.

      Parameters:

      value - Value.

      Returns:

      Instance corresponding to the numeric value.

    • parse

      public static MosaicFlags parse(Object rawValue)
      MosaicFlags.parse

      Parses a raw value into an instance.

      Parameters:

      rawValue - Raw value to parse.

      Returns:

      Parsed instance.

    • has

      public boolean has(int flag)
      MosaicFlags.has

      Checks whether a flag is set.

      Parameters:

      flag - Flag bit(s) to test.

      Returns:

      true if the flag is set, false otherwise.

    • equals

      public boolean equals(Object other)
      MosaicFlags.equals

      Compares this object with another for equality.

      Overrides:

      equals in class Object

      Parameters:

      other - Object to compare against.

      Returns:

      true if the objects are equal, false otherwise.

    • hashCode

      public int hashCode()
      MosaicFlags.hashCode

      Computes the hash code of this object.

      Overrides:

      hashCode in class Object

      Returns:

      Hash code of this object.

    • size

      public int size()
      MosaicFlags.size

      Calculates the size of the object.

      Specified by:

      size in interface Serializer

      Returns:

      Size of this object in bytes.

    • deserialize

      public static MosaicFlags deserialize(ByteBuffer buffer)
      MosaicFlags.deserialize

      Deserializes an instance of this object from a byte payload.

      Parameters:

      buffer - Output writer.

      Returns:

      Deserialized object.

      Throws:

      IndexOutOfBoundsException - if the buffer is truncated or a declared length overruns it

      IllegalArgumentException - if a field carries an invalid value (e.g. a reserved field or unknown discriminator)

    • serialize

      public byte[] serialize()
      MosaicFlags.serialize

      Serializes this object to bytes.

      Specified by:

      serialize in interface Serializer

      Returns:

      Serialized bytes.

    • toString

      public String toString()
      MosaicFlags.toString

      Returns a string representation of this object.

      Overrides:

      toString in class Object

      Returns:

      String representation of this object.

    • toJson

      public int toJson()
      MosaicFlags.toJson

      Converts this object to a JSON-serializable representation.

      Returns:

      JSON-serializable representation of this object.