Package org.forgerock.am.oauth2
Class AccessTokenResponse.Builder
java.lang.Object
org.forgerock.am.oauth2.AccessTokenResponse.Builder
- Enclosing class:
- AccessTokenResponse
Access token response builder.
- Since:
- 7.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccessToken
(String accessToken) Sets the access token.build()
Builds a new access token response instance, ensuring all prerequisites.Sets the expires in duration.Sets the scopes associated with access token.Sets the token type.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
accessToken
Sets the access token.- Parameters:
accessToken
- the access token- Returns:
- the builder instance
-
tokenType
Sets the token type.- Parameters:
tokenType
- the token type- Returns:
- the builder instance
-
expiresIn
Sets the expires in duration.- Parameters:
expiresIn
- the expires in duration- Returns:
- the builder instance
-
scopes
Sets the scopes associated with access token.- Parameters:
scopes
- the scopes associated with access token- Returns:
- the builder instance
-
build
Builds a new access token response instance, ensuring all prerequisites.- Returns:
- an access token response
- Throws:
NullPointerException
- if accessToken, tokenType or expiration are nullIllegalArgumentException
- if accessToken or tokenType are blank
-