Package discord4j.discordjson
Class Id
java.lang.Object
discord4j.discordjson.Id
Represents an unsigned 64-bit ID. This object is serialized through String despite using long field for
storage and is used when building immutable objects for an alternative compact structure, reducing required memory.
-
Method Summary
Modifier and TypeMethodDescriptionlongasLong()Gets the unsigned ID as a primitive long.asString()Gets the unsigned ID as an object String.booleaninthashCode()static Idof(long value) Constructs anIDutilizing an unsigned ID.static IdConstructs anIDutilizing an unsigned ID.toString()
-
Method Details
-
of
Constructs anIDutilizing an unsigned ID.- Parameters:
value- The unsigned ID to construct aID.- Returns:
- A constructed
IDwith the unsigned ID.
-
of
Constructs anIDutilizing an unsigned ID.- Parameters:
value- The unsigned ID to construct aID. Must be non-null.- Returns:
- A constructed
IDwith the unsigned ID. - Throws:
NumberFormatException- Ifidis not an unsigned ID.
-
asString
Gets the unsigned ID as an object String.- Returns:
- The unsigned ID as String.
-
asLong
public long asLong()Gets the unsigned ID as a primitive long.- Returns:
- The unsigned ID as long.
-
equals
-
hashCode
public int hashCode() -
toString
-