Package org.symbol.sdk.symbol.models
Class MosaicFlags
java.lang.Object
org.symbol.sdk.symbol.models.MosaicFlags
- All Implemented Interfaces:
Serializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MosaicFlagsstatic final MosaicFlagsstatic final MosaicFlagsstatic final MosaicFlagsstatic final MosaicFlagsfinal int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MosaicFlagsdeserialize(ByteBuffer buffer) Deserializes an instance of this object from a byte payload.booleanCompares this object with another for equality.static MosaicFlagsfromValue(int value) Creates an instance from its underlying numeric value.intgetValue()Gets the value field.booleanhas(int flag) Checks whether a flag is set.inthashCode()Computes the hash code of this object.static MosaicFlagsParses a raw value into an instance.byte[]Serializes this object to bytes.intsize()Calculates the size of the object.inttoJson()Converts this object to a JSON-serializable representation.toString()Returns a string representation of this object.
-
Field Details
-
NONE
-
SUPPLY_MUTABLE
-
TRANSFERABLE
-
RESTRICTABLE
-
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
- MosaicFlags.fromValue
- Creates an instance from its underlying numeric value.
- Parameters:
value- Value.- Returns:
- Instance corresponding to the numeric value.
-
parse
- 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
- MosaicFlags.equals
- Compares this object with another for equality.
-
hashCode
public int hashCode()- MosaicFlags.hashCode
- Computes the hash code of this object.
-
size
public int size()- MosaicFlags.size
- Calculates the size of the object.
- Specified by:
sizein interfaceSerializer- Returns:
- Size of this object in bytes.
-
deserialize
- 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 itIllegalArgumentException- 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:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
toString
- MosaicFlags.toString
- Returns a 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.
-