Class TokenCredential.Builder
- java.lang.Object
-
- io.helidon.security.providers.common.TokenCredential.Builder
-
- All Implemented Interfaces:
Builder<TokenCredential>
,Supplier<TokenCredential>
- Enclosing class:
- TokenCredential
public static final class TokenCredential.Builder extends Object implements Builder<TokenCredential>
Fluent API builder forTokenCredential
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,U extends T>
TokenCredential.BuilderaddToken(Class<T> tokenClass, U tokenInstance)
Add a token instance (such as JWT instance).TokenCredential.Builder
addToken(Object token)
Add a token instance (such as JWT instance).TokenCredential
build()
Build the instance from this builder.TokenCredential.Builder
expTime(Instant expirationTime)
Time the token would expire.TokenCredential.Builder
issuer(String issuer)
Issuer of the token.TokenCredential.Builder
issueTime(Instant issueTime)
Time the token was issued.TokenCredential.Builder
token(String token)
Set the token content (the actual string travelling on the network).
-
-
-
Method Detail
-
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 instanceU
- type of class to register instance by- Parameters:
tokenClass
- class we want to register the instance undertokenInstance
- 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 throughObject.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 interfaceBuilder<TokenCredential>
- Returns:
- instance of the built type
-
-