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 int
hashCode
private 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 void
addCredential(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.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(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, 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: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
-
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
)
-
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
-
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
)
-
addCredential
private void addCredential(Credential credential, LinkedHashMap<IdentityCredentials.Key,Credential> map)
-
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
-
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
)
-
-