Class NumberOfClaimValuesActivationCondition
java.lang.Object
net.shibboleth.oidc.security.jwt.claims.impl.NumberOfClaimValuesActivationCondition
- All Implemented Interfaces:
BiPredicate<ProfileRequestContext,JWTClaimsSet>
@ThreadSafe
public class NumberOfClaimValuesActivationCondition
extends Object
implements BiPredicate<ProfileRequestContext,JWTClaimsSet>
Activation condition to check the number of values a claim has against a given predicate.
A claim that does not exist will still be tested with a size of 0.
A claim that exists but not as a list will be assumed to have a single value (size = 1).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe name of the claim to check exists in the claims set.private final IntPredicateThe predicate used to determine if the claim has the correct number of values. -
Constructor Summary
ConstructorsConstructorDescriptionNumberOfClaimValuesActivationCondition(String claimName, IntPredicate predicate) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleantest(ProfileRequestContext context, JWTClaimsSet claims) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, negate, or
-
Field Details
-
claimToCheck
The name of the claim to check exists in the claims set. -
numberOfValuesPredicate
The predicate used to determine if the claim has the correct number of values.
-
-
Constructor Details
-
NumberOfClaimValuesActivationCondition
public NumberOfClaimValuesActivationCondition(@Nonnull @NotEmpty @ParameterName(name="claimToCheck") String claimName, @Nonnull @ParameterName(name="numberOfValuesPredicate") IntPredicate predicate) Constructor.- Parameters:
claimName- the name of the claim to check exists in the claims set.predicate- the predicate used to determine if the claim has the correct number of values.
-
-
Method Details
-
test
- Specified by:
testin interfaceBiPredicate<ProfileRequestContext,JWTClaimsSet>
-