public static final class TokenResponse.Builder extends Object
TokenResponse
.Constructor and Description |
---|
Builder(TokenRequest request)
Creates a token response associated with the specified request.
|
Modifier and Type | Method and Description |
---|---|
TokenResponse |
build()
Creates the token response instance.
|
TokenResponse.Builder |
setAccessToken(String accessToken)
Specifies the access token.
|
TokenResponse.Builder |
setAccessTokenExpirationTime(Long expiresAt)
Sets the exact expiration time of the access token, in milliseconds since the UNIX epoch.
|
TokenResponse.Builder |
setAccessTokenExpiresIn(Long expiresIn)
Sets the relative expiration time of the access token, in seconds, using the default
system clock as the source of the current time.
|
TokenResponse.Builder |
setAdditionalParameters(Map<String,String> additionalParameters)
Specifies the additional, non-standard parameters received as part of the response.
|
TokenResponse.Builder |
setIdToken(String idToken)
Specifies the ID token.
|
TokenResponse.Builder |
setRefreshToken(String refreshToken)
Specifies the refresh token.
|
TokenResponse.Builder |
setRequest(TokenRequest request)
Specifies the request associated with this response.
|
TokenResponse.Builder |
setScope(String scope)
Specifies the encoded scope string, which is a space-delimited set of
case-sensitive scope identifiers.
|
TokenResponse.Builder |
setScopes(Iterable<String> scopes)
Specifies the set of case-sensitive scopes.
|
TokenResponse.Builder |
setScopes(String... scopes)
Specifies the set of case-sensitive scopes.
|
TokenResponse.Builder |
setTokenType(String tokenType)
Specifies the token type of the access token in this response.
|
public Builder(@NonNull TokenRequest request)
@NonNull public TokenResponse.Builder setRequest(@NonNull TokenRequest request)
@NonNull public TokenResponse.Builder setTokenType(@Nullable String tokenType)
@NonNull public TokenResponse.Builder setAccessToken(@Nullable String accessToken)
@NonNull public TokenResponse.Builder setAccessTokenExpiresIn(@NonNull Long expiresIn)
@NonNull public TokenResponse.Builder setAccessTokenExpirationTime(@Nullable Long expiresAt)
public TokenResponse.Builder setIdToken(@Nullable String idToken)
public TokenResponse.Builder setRefreshToken(@Nullable String refreshToken)
@NonNull public TokenResponse.Builder setScope(@Nullable String scope)
@NonNull public TokenResponse.Builder setScopes(String... scopes)
Scopes specified here are used to obtain a "down-scoped" access token, where the set of scopes specified must be a subset of those already granted in previous requests.
@NonNull public TokenResponse.Builder setScopes(@Nullable Iterable<String> scopes)
Scopes specified here are used to obtain a "down-scoped" access token, where the set of scopes specified must be a subset of those already granted in previous requests.
@NonNull public TokenResponse.Builder setAdditionalParameters(@Nullable Map<String,String> additionalParameters)
public TokenResponse build()