public class Identifier extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Identifier>, net.minidev.json.JSONAware
Extending classes must override the equals(java.lang.Object) method.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BYTE_LENGTH
The default byte length of generated identifiers.
|
| Constructor and Description |
|---|
Identifier()
Creates a new identifier with a randomly generated 256-bit
(32-byte) value, Base64URL-encoded.
|
Identifier(int byteLength)
Creates a new identifier with a randomly generated value of the
specified byte length, Base64URL-encoded.
|
Identifier(java.lang.String value)
Creates a new identifier with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Identifier other) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getValue()
Returns the value of this identifier.
|
int |
hashCode() |
java.lang.String |
toJSONString()
Returns the JSON string representation of this identifier.
|
java.lang.String |
toString() |
public static final int DEFAULT_BYTE_LENGTH
public Identifier(java.lang.String value)
value - The identifier value. Must not be null or empty
string.public Identifier(int byteLength)
byteLength - The byte length of the value to generate. Must be
greater than one.public Identifier()
public java.lang.String getValue()
public java.lang.String toJSONString()
toJSONString in interface net.minidev.json.JSONAwarepublic java.lang.String toString()
toString in class java.lang.ObjectgetValue()public int compareTo(Identifier other)
compareTo in interface java.lang.Comparable<Identifier>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2016 Connect2id Ltd.. All Rights Reserved.