Class Token.TokenBuilder<T,B extends Token.TokenBuilder<T,B>>
java.lang.Object
com.atlassian.bitbucket.jenkins.internal.applink.oauth.Token.TokenBuilder<T,B>
- Type Parameters:
T- type of the token being constructedB- type of theTokenBuilderimplementation, so that the attribute setting methods can return objects of the type of the subclassed builder in case additional properties are added and need to be set
- Direct Known Subclasses:
ServiceProviderToken.ServiceProviderTokenBuilder
- Enclosing class:
- Token
Base builder that can be used by
Token subclasses to build token instances. All attributes are required
to be set for the Token to be constructed properly.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tbuild()final BSets theconsumerattribute of the requestTokenobject under construction and returns the next builder in the chain, which allows optional attributes to be set and the final requestTokeninstance to be constructed.final Bproperties(Map<String, String> properties) Sets thepropertiesfor the request token and returnsthisbuilder.final BtokenSecret(String tokenSecret) Sets thetokenSecretattribute of theTokenunder construction and returns this builder to allow for other attributes to be set.
-
Constructor Details
-
TokenBuilder
-
-
Method Details
-
tokenSecret
Sets thetokenSecretattribute of theTokenunder construction and returns this builder to allow for other attributes to be set.- Parameters:
tokenSecret- the secret used by theConsumerto establish ownership of a givenToken- Returns:
- this builder to allow other properties to be set
-
consumer
Sets theconsumerattribute of the requestTokenobject under construction and returns the next builder in the chain, which allows optional attributes to be set and the final requestTokeninstance to be constructed.- Parameters:
consumer- theConsumerthat owns the token- Returns:
- the next builder in the chain
-
properties
Sets thepropertiesfor the request token and returnsthisbuilder.- Parameters:
properties-Map<String, String>of properties to associate with the request token- Returns:
thisbuilder
-
build
-