Class TokenCredential.Builder

java.lang.Object
io.helidon.security.providers.common.TokenCredential.Builder
All Implemented Interfaces:
Builder<TokenCredential.Builder,TokenCredential>, Supplier<TokenCredential>
Enclosing class:
TokenCredential

public static final class TokenCredential.Builder extends Object implements Builder<TokenCredential.Builder,TokenCredential>
Fluent API builder for TokenCredential.
  • Method Details

    • token

      public TokenCredential.Builder token(String token)
      Set the token content (the actual string travelling on the network).
      Parameters:
      token - token value
      Returns:
      updated builder instance
    • issueTime

      public TokenCredential.Builder issueTime(Instant issueTime)
      Time the token was issued.
      Parameters:
      issueTime - issue instant
      Returns:
      updated builder instance
    • expTime

      public TokenCredential.Builder expTime(Instant expirationTime)
      Time the token would expire.
      Parameters:
      expirationTime - expiration instant
      Returns:
      updated builder instance
    • issuer

      public TokenCredential.Builder issuer(String issuer)
      Issuer of the token.
      Parameters:
      issuer - issuer (such as accounts.google.com)
      Returns:
      updated builder instance
    • addToken

      public <T, U extends T> TokenCredential.Builder addToken(Class<T> tokenClass, U tokenInstance)
      Add a token instance (such as JWT instance). May contain more than one instance (e.g. for JWT, we may send both SignedJwt and Jwt).
      Type Parameters:
      T - type of instance
      U - type of class to register instance by
      Parameters:
      tokenClass - class we want to register the instance under
      tokenInstance - instance
      Returns:
      updated builder instance
    • addToken

      public TokenCredential.Builder addToken(Object token)
      Add a token instance (such as JWT instance). May contain more than one instance (e.g. for JWT, we may send both SignedJwt and Jwt). Object is registered under the class it provides through Object.getClass().
      Parameters:
      token - instance
      Returns:
      updated builder instance
    • build

      public TokenCredential build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<TokenCredential.Builder,TokenCredential>
      Returns:
      instance of the built type