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 constructed
B - type of the TokenBuilder implementation, 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

public abstract static class Token.TokenBuilder<T,B extends Token.TokenBuilder<T,B>> extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
     
    final B
    consumer(Consumer consumer)
    Sets the consumer attribute of the request Token object under construction and returns the next builder in the chain, which allows optional attributes to be set and the final request Token instance to be constructed.
    final B
    properties(Map<String,String> properties)
    Sets the properties for the request token and returns this builder.
    final B
    tokenSecret(String tokenSecret)
    Sets the tokenSecret attribute of the Token under construction and returns this builder to allow for other attributes to be set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • tokenSecret

      public final B tokenSecret(String tokenSecret)
      Sets the tokenSecret attribute of the Token under construction and returns this builder to allow for other attributes to be set.
      Parameters:
      tokenSecret - the secret used by the Consumer to establish ownership of a given Token
      Returns:
      this builder to allow other properties to be set
    • consumer

      public final B consumer(Consumer consumer)
      Sets the consumer attribute of the request Token object under construction and returns the next builder in the chain, which allows optional attributes to be set and the final request Token instance to be constructed.
      Parameters:
      consumer - the Consumer that owns the token
      Returns:
      the next builder in the chain
    • properties

      public final B properties(Map<String,String> properties)
      Sets the properties for the request token and returns this builder.
      Parameters:
      properties - Map<String, String> of properties to associate with the request token
      Returns:
      this builder
    • build

      public abstract T build()