Class AuthenticationTokenContext<T>
java.lang.Object
jenkins.authentication.tokens.api.AuthenticationTokenContext<T>
- Type Parameters:
T- the type of token
The context within which an authentication token will be used.
- Since:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA non-thread safe builder ofAuthenticationTokenContextinstances. -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationTokenContext(Class<T> tokenClass) Creates a basic context for any purpose. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AuthenticationTokenContext.Builder<T>Creates aAuthenticationTokenContext.Builderfor contexts of the specified token type.booleanChecks if the context specifies the supplied purpose and matches against the valid values.Returns the type of token.booleanEnsures the context specifies the supplied purpose matching against the valid values.
-
Constructor Details
-
AuthenticationTokenContext
Creates a basic context for any purpose.- Parameters:
tokenClass- the type of token.
-
-
Method Details
-
builder
Creates aAuthenticationTokenContext.Builderfor contexts of the specified token type.- Type Parameters:
T- the type of token.- Parameters:
tokenClass- the type of token.- Returns:
- a
AuthenticationTokenContext.Builderinstance.
-
getTokenClass
Returns the type of token.- Returns:
- the type of token.
-
canHave
Checks if the context specifies the supplied purpose and matches against the valid values.- Parameters:
purpose- the purpose.validValues- the valid values that the purpose must match if specified.- Returns:
trueif either the purpose is not specified or the purpose is specified and is equal to one of the specified values.
-
mustHave
Ensures the context specifies the supplied purpose matching against the valid values.- Parameters:
purpose- the purpose.validValues- the valid values that the purpose must match.- Returns:
trueif and only if the purpose is specified and is equal to one of the specified values.
-