Package org.wildfly.security.auth.server
Class IdentityCredentials.Two
- java.lang.Object
-
- org.wildfly.security.auth.server.IdentityCredentials
-
- org.wildfly.security.auth.server.IdentityCredentials.Two
-
- All Implemented Interfaces:
Iterable<Credential>
,CredentialSource
- Enclosing class:
- IdentityCredentials
static class IdentityCredentials.Two extends IdentityCredentials
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.wildfly.security.auth.server.IdentityCredentials
IdentityCredentials.Key, IdentityCredentials.Many, IdentityCredentials.One, IdentityCredentials.Two
-
-
Field Summary
Fields Modifier and Type Field Description private Credential
credential1
private Credential
credential2
-
Fields inherited from class org.wildfly.security.auth.server.IdentityCredentials
NONE
-
-
Constructor Summary
Constructors Constructor Description Two(Credential credential1, Credential credential2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends Credential,R>
RapplyToCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Function<C,R> function)
Apply the given function to the acquired credential, if it is set and of the given type and algorithm.boolean
contains(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Determine whether a credential of the given type and algorithm are present in this set.boolean
equals(Object obj)
void
forEach(Consumer<? super Credential> action)
<C extends Credential>
CgetCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Acquire a credential of the given type and algorithm name.int
hashCode()
Iterator<Credential>
iterator()
int
size()
Get the size of this credential set.IdentityCredentials
with(IdentityCredentials other)
Return a copy of this credential set with the given credential set added to it.CredentialSource
with(CredentialSource other)
Aggregate this credential source with another.IdentityCredentials
withCredential(Credential credential)
Return a copy of this credential set, but with the given credential added to it.IdentityCredentials
without(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Return a copy of this credential set without any credentials of the given type, algorithm name and parameter spec.IdentityCredentials
without(Predicate<? super Credential> predicate)
Return a copy of this credential set without any credentials that match the predicate.IdentityCredentials
withoutMatching(Credential credential)
Return a copy of this credential set without any credentials with a type, algorithm name, and parameters matching that of the given credential.-
Methods inherited from class org.wildfly.security.auth.server.IdentityCredentials
applyToCredential, applyToCredential, canVerify, canVerify, contains, contains, containsMatching, getCredential, getCredential, getCredentialAcquireSupport, getCredentialAcquireSupport, getCredentialAcquireSupport, spliterator, typeHash, verify, verify, verify, verify, without, without, without
-
-
-
-
Field Detail
-
credential1
private final Credential credential1
-
credential2
private final Credential credential2
-
-
Constructor Detail
-
Two
Two(Credential credential1, Credential credential2)
-
-
Method Detail
-
contains
public boolean contains(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Description copied from class:IdentityCredentials
Determine whether a credential of the given type and algorithm are present in this set.- Specified by:
contains
in classIdentityCredentials
- Parameters:
credentialType
- the credential type class (must not benull
)algorithmName
- the algorithm name, ornull
if any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec
- the parameter specification ornull
if any parameter specification is acceptable- Returns:
true
if a matching credential is contained in this set,false
otherwise
-
getCredential
public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Description copied from class:IdentityCredentials
Acquire a credential of the given type and algorithm name.- Specified by:
getCredential
in interfaceCredentialSource
- Specified by:
getCredential
in classIdentityCredentials
- Type Parameters:
C
- the credential type- Parameters:
credentialType
- the credential type class (must not benull
)algorithmName
- the algorithm name, ornull
if any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec
- the parameter specification ornull
if any parameter specification is acceptable- Returns:
- the credential, or
null
if no such credential exists
-
withCredential
public IdentityCredentials withCredential(Credential credential)
Description copied from class:IdentityCredentials
Return a copy of this credential set, but with the given credential added to it.- Specified by:
withCredential
in classIdentityCredentials
- Parameters:
credential
- the credential to append (must not benull
)- Returns:
- the new credential set (not
null
)
-
with
public IdentityCredentials with(IdentityCredentials other)
Description copied from class:IdentityCredentials
Return a copy of this credential set with the given credential set added to it.- Specified by:
with
in classIdentityCredentials
- Parameters:
other
- the credential set to append (must not benull
)- Returns:
- the new credential set (not
null
)
-
with
public CredentialSource with(CredentialSource other)
Description copied from interface:CredentialSource
Aggregate this credential source with another.- Parameters:
other
- the other credential source (must not benull
)- Returns:
- the aggregated credential source (not
null
)
-
iterator
public Iterator<Credential> iterator()
-
applyToCredential
public <C extends Credential,R> R applyToCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Function<C,R> function)
Description copied from class:IdentityCredentials
Apply the given function to the acquired credential, if it is set and of the given type and algorithm.- Specified by:
applyToCredential
in interfaceCredentialSource
- Overrides:
applyToCredential
in classIdentityCredentials
- Type Parameters:
C
- the credential typeR
- the return type- Parameters:
credentialType
- the credential type class (must not benull
)algorithmName
- the algorithm nameparameterSpec
- the parameter specification ornull
if any parameter specification is acceptablefunction
- the function to apply (must not benull
)- Returns:
- the result of the function, or
null
if the criteria are not met
-
withoutMatching
public IdentityCredentials withoutMatching(Credential credential)
Description copied from class:IdentityCredentials
Return a copy of this credential set without any credentials with a type, algorithm name, and parameters matching that of the given credential. If the credential type, algorithm name, and parameters are not found in this set, return this instance.- Overrides:
withoutMatching
in classIdentityCredentials
- Parameters:
credential
- the credential to match against (must not benull
)- Returns:
- the new credential set (not
null
)
-
without
public IdentityCredentials without(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Description copied from class:IdentityCredentials
Return a copy of this credential set without any credentials of the given type, algorithm name and parameter spec. If the credential type and algorithm name is not found in this set, return this instance.- Specified by:
without
in interfaceCredentialSource
- Overrides:
without
in classIdentityCredentials
- Parameters:
credentialType
- the credential type to remove (must not benull
)algorithmName
- the algorithm name to remove, ornull
to match any algorithm nameparameterSpec
- the parameter spec to remove, ornull
to match any parameter spec- Returns:
- the new credential set (not
null
)
-
without
public IdentityCredentials without(Predicate<? super Credential> predicate)
Description copied from class:IdentityCredentials
Return a copy of this credential set without any credentials that match the predicate. If no credentials match the predicate, return this instance.- Specified by:
without
in classIdentityCredentials
- Parameters:
predicate
- the predicate to test (must not benull
)- Returns:
- the new credential set (not
null
)
-
forEach
public void forEach(Consumer<? super Credential> action)
-
size
public int size()
Description copied from class:IdentityCredentials
Get the size of this credential set.- Specified by:
size
in classIdentityCredentials
- Returns:
- the size of this credential set
-
-