@Immutable public final class RefreshToken extends Token implements Comparable<RefreshToken>
Related specifications:
DEFAULT_BYTE_LENGTH| Constructor and Description |
|---|
RefreshToken()
Creates a new refresh token with a randomly generated 256-bit
(32-byte) value, Base64URL-encoded.
|
RefreshToken(int byteLength)
Creates a new refresh token with a randomly generated value of the
specified length, Base64URL-encoded.
|
RefreshToken(String value)
Creates a new refresh token with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(RefreshToken other) |
boolean |
equals(Object object)
Overrides
Object.equals(). |
static RefreshToken |
parse(net.minidev.json.JSONObject jsonObject)
Parses a refresh token from a JSON object access token response.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns the token parameters as a JSON object, as required for the
composition of an access token response.
|
getValue, hashCode, toJSONString, toStringpublic RefreshToken()
public RefreshToken(int byteLength)
byteLength - The byte length of the value to generate. Must be
greater than one.public RefreshToken(String value)
value - The refresh token value. Must not be null or
empty string.public net.minidev.json.JSONObject toJSONObject()
TokenNote that JSONObject implements Map<String,Object>.
Example:
{
"access_token" : "2YotnFZFEjr1zCsicMWpAA",
"token_type" : "example",
"expires_in" : 3600,
"example_parameter" : "example_value"
}
toJSONObject in class Tokenpublic static RefreshToken parse(net.minidev.json.JSONObject jsonObject) throws ParseException
jsonObject - The JSON object to parse. Must not be
null.null if not found.ParseException - If the JSON object couldn't be parsed to a
refresh token.public boolean equals(Object object)
IdentifierObject.equals().equals in class Identifierobject - The object to compare to.true if the objects have the same value, otherwise
false.public int compareTo(RefreshToken other)
compareTo in interface Comparable<RefreshToken>Copyright © 2013 NimbusDS. All Rights Reserved.