Identifier
, Comparable<Identifier>
, net.minidev.json.JSONAware
AuthzId
, CID
, DNIdentity
, IdentifierWithHMAC
, SID
, UID
, Username
public abstract class BaseIdentifier extends Object implements Identifier, Comparable<Identifier>, net.minidev.json.JSONAware
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_BYTE_LENGTH |
The default byte length of generated identifiers.
|
protected static SecureRandom |
SECURE_RANDOM |
The secure random generator.
|
Constructor | Description |
---|---|
BaseIdentifier() |
Creates a new unique identifier (ID) based on a secure randomly
generated 256-bit number, Base64URL-encoded.
|
BaseIdentifier(int byteLength) |
Creates a new unique identifier (ID) based on a secure randomly
generated number with the specified byte length, Base64URL-encoded.
|
BaseIdentifier(String value) |
Creates a new identifier (ID) from the specified string.
|
Modifier and Type | Method | 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(int byteLength)
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 © 2018 Connect2id. All rights reserved.