Class Token.TokenBuilder<T,​B extends 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 Detail

    • Method Detail

      • 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()