@Immutable public final class RefreshToken extends Token
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 |
---|---|
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.
|
compareTo, getValue, hashCode, toJSONString, toString
public 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()
Token
Note that JSONObject implements Map<String,Object>.
Example:
{ "access_token" : "2YotnFZFEjr1zCsicMWpAA", "token_type" : "example", "expires_in" : 3600, "example_parameter" : "example_value" }
toJSONObject
in class Token
public 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)
Identifier
Object.equals()
.equals
in class Identifier
object
- The object to compare to.true
if the objects have the same value, otherwise
false
.Copyright © 2014 Connect2id Ltd.. All Rights Reserved.