Class TokenResponse
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.client.auth.oauth2.TokenResponse
-
- Direct Known Subclasses:
IdTokenResponse
public class TokenResponse extends com.google.api.client.json.GenericJsonOAuth 2.0 JSON model for a successful access token response as specified in Successful Response.Implementation is not thread-safe.
- Since:
- 1.7
- Author:
- Yaniv Inbar
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description TokenResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenResponseclone()StringgetAccessToken()Returns the access token issued by the authorization server.LonggetExpiresInSeconds()Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.StringgetRefreshToken()Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.StringgetScope()Returns the scope of the access token ornullfor none.StringgetTokenType()Returns the token type (as specified in Access Token Types).TokenResponseset(String fieldName, Object value)TokenResponsesetAccessToken(String accessToken)Sets the access token issued by the authorization server.TokenResponsesetExpiresInSeconds(Long expiresInSeconds)Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.TokenResponsesetRefreshToken(String refreshToken)Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.TokenResponsesetScope(String scope)Sets the scope of the access token ornullfor none.TokenResponsesetTokenType(String tokenType)Sets the token type (as specified in Access Token Types).-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
-
-
-
-
Method Detail
-
getAccessToken
public final String getAccessToken()
Returns the access token issued by the authorization server.
-
setAccessToken
public TokenResponse setAccessToken(String accessToken)
Sets the access token issued by the authorization server.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getTokenType
public final String getTokenType()
Returns the token type (as specified in Access Token Types).
-
setTokenType
public TokenResponse setTokenType(String tokenType)
Sets the token type (as specified in Access Token Types).Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getExpiresInSeconds
public final Long getExpiresInSeconds()
Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.
-
setExpiresInSeconds
public TokenResponse setExpiresInSeconds(Long expiresInSeconds)
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getRefreshToken
public final String getRefreshToken()
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.
-
setRefreshToken
public TokenResponse setRefreshToken(String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getScope
public final String getScope()
Returns the scope of the access token ornullfor none.
-
setScope
public TokenResponse setScope(String scope)
Sets the scope of the access token ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
set
public TokenResponse set(String fieldName, Object value)
- Overrides:
setin classcom.google.api.client.json.GenericJson
-
clone
public TokenResponse clone()
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-
-