|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nimbusds.oauth2.sdk.id.Identifier
com.nimbusds.oauth2.sdk.token.Token
com.nimbusds.oauth2.sdk.token.RefreshToken
@Immutable public final class RefreshToken
Refresh token. This class is immutable.
Related specifications:
Field Summary |
---|
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier |
---|
DEFAULT_BYTE_LENGTH |
Constructor Summary | |
---|---|
RefreshToken()
Creates a new refresh token with a randomly generated value. |
|
RefreshToken(int length)
Creates a new refresh token with a randomly generated value of the specified length. |
|
RefreshToken(String value)
Creates a new refresh token with the specified value. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier |
---|
getValue, hashCode, toJSONString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RefreshToken()
public RefreshToken(int length)
length
- The number of characters. Must be a positive integer.public RefreshToken(String value)
value
- The refresh token value. Must not be null
or
empty string.Method Detail |
---|
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
.public int compareTo(RefreshToken other)
compareTo
in interface Comparable<RefreshToken>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |