Package org.wildfly.security.auth.server
Class IdentityCredentials.Many
- java.lang.Object
-
- org.wildfly.security.auth.server.IdentityCredentials
-
- org.wildfly.security.auth.server.IdentityCredentials.Many
-
- All Implemented Interfaces:
Iterable<Credential>,CredentialSource
- Enclosing class:
- IdentityCredentials
static class IdentityCredentials.Many 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 inthashCodeprivate LinkedHashMap<IdentityCredentials.Key,Credential>map-
Fields inherited from class org.wildfly.security.auth.server.IdentityCredentials
NONE
-
-
Constructor Summary
Constructors Constructor Description Many(LinkedHashMap<IdentityCredentials.Key,Credential> map)Many(Credential c1, IdentityCredentials.Many subsequent)Many(Credential c1, Credential c2, IdentityCredentials.Many subsequent)Many(Credential credential1, Credential credential2, Credential credential3)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddCredential(Credential credential, LinkedHashMap<IdentityCredentials.Key,Credential> map)<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(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, without
-
-
-
-
Field Detail
-
map
private final LinkedHashMap<IdentityCredentials.Key,Credential> map
-
hashCode
private final int hashCode
-
-
Constructor Detail
-
Many
Many(Credential c1, IdentityCredentials.Many subsequent)
-
Many
Many(Credential c1, Credential c2, IdentityCredentials.Many subsequent)
-
Many
Many(LinkedHashMap<IdentityCredentials.Key,Credential> map)
-
Many
Many(Credential credential1, Credential credential2, Credential credential3)
-
-
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
-
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)
-
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
-
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)
-
addCredential
private void addCredential(Credential credential, LinkedHashMap<IdentityCredentials.Key,Credential> map)
-
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
-
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)
-
-