Class OAuth2CredentialsWithRefresh.Builder
java.lang.Object
com.google.auth.oauth2.OAuth2Credentials.Builder
com.google.auth.oauth2.OAuth2CredentialsWithRefresh.Builder
- Enclosing class:
OAuth2CredentialsWithRefresh
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()setAccessToken(AccessToken token) Sets theAccessTokento be consumed.Sets theOAuth2CredentialsWithRefresh.OAuth2RefreshHandlerto be used for token refreshes.Methods inherited from class OAuth2Credentials.Builder
getAccessToken, getExpirationMargin, getRefreshMargin, setExpirationMargin, setRefreshMargin
-
Field Details
-
refreshHandler
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
setAccessToken
Sets theAccessTokento be consumed. It must contain an expiration time otherwise anIllegalArgumentExceptionwill be thrown.- Overrides:
setAccessTokenin classOAuth2Credentials.Builder
-
setRefreshHandler
@CanIgnoreReturnValue public OAuth2CredentialsWithRefresh.Builder setRefreshHandler(OAuth2CredentialsWithRefresh.OAuth2RefreshHandler handler) Sets theOAuth2CredentialsWithRefresh.OAuth2RefreshHandlerto be used for token refreshes. -
build
- Overrides:
buildin classOAuth2Credentials.Builder
-