public abstract class BaseIdentifier extends Object implements Identifier, Comparable<Identifier>, net.minidev.json.JSONAware
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BYTE_LENGTH
The default byte length of generated identifiers.
|
protected static SecureRandom |
SECURE_RANDOM
The secure random generator.
|
Constructor and Description |
---|
BaseIdentifier()
Creates a new unique identifier (ID) based on a secure randomly
generated 256-bit number, Base64URL-encoded.
|
BaseIdentifier(String value)
Creates a new identifier (ID) from the specified string.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Identifier other) |
abstract boolean |
equals(Object object)
Overrides
Object.equals() . |
int |
hashCode()
Overrides
Object.hashCode() . |
String |
toJSONString()
Returns the JSON string representation of this identifier (ID).
|
String |
toString()
Returns the string representation of this identifier (ID).
|
protected static final SecureRandom SECURE_RANDOM
public static final int DEFAULT_BYTE_LENGTH
public BaseIdentifier()
public BaseIdentifier(String value)
value
- The identifier (ID) value. Must not be null
.public int compareTo(Identifier other)
compareTo
in interface Comparable<Identifier>
public int hashCode()
Object.hashCode()
.public String toJSONString()
toJSONString
in interface net.minidev.json.JSONAware
Copyright © 2016 Connect2id. All Rights Reserved.