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 Credentialcredential1private Credentialcredential2-
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.booleancontains(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)Determine whether a credential of the given type and algorithm are present in this set.booleanequals(Object obj)voidforEach(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.inthashCode()Iterator<Credential>iterator()intsize()Get the size of this credential set.IdentityCredentialswith(IdentityCredentials other)Return a copy of this credential set with the given credential set added to it.CredentialSourcewith(CredentialSource other)Aggregate this credential source with another.IdentityCredentialswithCredential(Credential credential)Return a copy of this credential set, but with the given credential added to it.IdentityCredentialswithout(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.IdentityCredentialswithout(Predicate<? super Credential> predicate)Return a copy of this credential set without any credentials that match the predicate.IdentityCredentialswithoutMatching(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:IdentityCredentialsDetermine whether a credential of the given type and algorithm are present in this set.- Specified by:
containsin classIdentityCredentials- Parameters:
credentialType- the credential type class (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec- the parameter specification ornullif any parameter specification is acceptable- Returns:
trueif a matching credential is contained in this set,falseotherwise
-
getCredential
public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
Description copied from class:IdentityCredentialsAcquire a credential of the given type and algorithm name.- Specified by:
getCredentialin interfaceCredentialSource- Specified by:
getCredentialin classIdentityCredentials- Type Parameters:
C- the credential type- Parameters:
credentialType- the credential type class (must not benull)algorithmName- the algorithm name, ornullif any algorithm is acceptable or the credential type does not support algorithm namesparameterSpec- the parameter specification ornullif any parameter specification is acceptable- Returns:
- the credential, or
nullif no such credential exists
-
withCredential
public IdentityCredentials withCredential(Credential credential)
Description copied from class:IdentityCredentialsReturn a copy of this credential set, but with the given credential added to it.- Specified by:
withCredentialin 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:IdentityCredentialsReturn a copy of this credential set with the given credential set added to it.- Specified by:
within 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:CredentialSourceAggregate 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:IdentityCredentialsApply the given function to the acquired credential, if it is set and of the given type and algorithm.- Specified by:
applyToCredentialin interfaceCredentialSource- Overrides:
applyToCredentialin 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 ornullif any parameter specification is acceptablefunction- the function to apply (must not benull)- Returns:
- the result of the function, or
nullif the criteria are not met
-
withoutMatching
public IdentityCredentials withoutMatching(Credential credential)
Description copied from class:IdentityCredentialsReturn 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:
withoutMatchingin 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:IdentityCredentialsReturn 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:
withoutin interfaceCredentialSource- Overrides:
withoutin classIdentityCredentials- Parameters:
credentialType- the credential type to remove (must not benull)algorithmName- the algorithm name to remove, ornullto match any algorithm nameparameterSpec- the parameter spec to remove, ornullto match any parameter spec- Returns:
- the new credential set (not
null)
-
without
public IdentityCredentials without(Predicate<? super Credential> predicate)
Description copied from class:IdentityCredentialsReturn a copy of this credential set without any credentials that match the predicate. If no credentials match the predicate, return this instance.- Specified by:
withoutin 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:IdentityCredentialsGet the size of this credential set.- Specified by:
sizein classIdentityCredentials- Returns:
- the size of this credential set
-
-