com.nimbusds.oauth2.sdk.token
Class TokenPair

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.token.TokenPair

public final class TokenPair
extends Object

Access and refresh token pair. This class is immutable.

Version:
$version$ (2013-02-13)
Author:
Vladimir Dzhuvinov

Constructor Summary
TokenPair(AccessToken accessToken, RefreshToken refreshToken)
          Creates a new access and refresh token pair.
 
Method Summary
 AccessToken getAccessToken()
          Gets the access token.
 RefreshToken getRefreshToken()
          Gets the refresh token.
 net.minidev.json.JSONObject toJSONObject()
          Returns the JSON object representation of this token pair.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenPair

public TokenPair(AccessToken accessToken,
                 RefreshToken refreshToken)
Creates a new access and refresh token pair.

Parameters:
accessToken - The access token. Must not be null.
refreshToken - The refresh token. If none null.
Method Detail

getAccessToken

public AccessToken getAccessToken()
Gets the access token.

Returns:
The access token.

getRefreshToken

public RefreshToken getRefreshToken()
Gets the refresh token.

Returns:
The refresh token. If none null.

toJSONObject

public net.minidev.json.JSONObject toJSONObject()
Returns the JSON object representation of this token pair.

Example JSON object:

 {
   "access_token"  : "dZdt8BlltORMTz5U",
   "refresh_token" : "E87zjAoeNXaSoF1U"
 }
 

Returns:
The JSON object representation.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 NimbusDS. All Rights Reserved.