Class NumberOfClaimValuesActivationCondition
- java.lang.Object
-
- net.shibboleth.oidc.security.jwt.claims.impl.NumberOfClaimValuesActivationCondition
-
- All Implemented Interfaces:
BiPredicate<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet>
@ThreadSafe public class NumberOfClaimValuesActivationCondition extends Object implements BiPredicate<ProfileRequestContext,com.nimbusds.jwt.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
Fields Modifier and Type Field Description private StringclaimToCheckThe name of the claim to check exists in the claims set.private IntPredicatenumberOfValuesPredicateThe predicate used to determine if the claim has the correct number of values.
-
Constructor Summary
Constructors Constructor Description NumberOfClaimValuesActivationCondition(String claimName, IntPredicate predicate)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleantest(ProfileRequestContext context, com.nimbusds.jwt.JWTClaimsSet claims)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiPredicate
and, negate, or
-
-
-
-
Field Detail
-
claimToCheck
@Nonnull @NotEmpty private final String claimToCheck
The name of the claim to check exists in the claims set.
-
numberOfValuesPredicate
@Nonnull private final IntPredicate numberOfValuesPredicate
The predicate used to determine if the claim has the correct number of values.
-
-
Constructor Detail
-
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 Detail
-
test
public boolean test(@Nonnull ProfileRequestContext context, @Nonnull com.nimbusds.jwt.JWTClaimsSet claims)- Specified by:
testin interfaceBiPredicate<ProfileRequestContext,com.nimbusds.jwt.JWTClaimsSet>
-
-