Class 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 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.