Class AttributePredicate

All Implemented Interfaces:
Predicate<IdPAttribute>, Component, DestructableComponent, InitializableComponent, Predicate<IdPAttribute>

public class AttributePredicate extends AbstractInitializableComponent implements Predicate<IdPAttribute>
Predicate to determine whether consent should be obtained for an attribute.
  • Field Details

    • promptedAttributeIds

      @Nonnull @NonnullElements private Set<String> promptedAttributeIds
      Set of attribute IDs for which to prompt for consent.
    • ignoredAttributeIds

      @Nonnull @NonnullElements private Set<String> ignoredAttributeIds
      Set of attribute IDs to ignore for consent.
    • matchExpression

      @Nullable private Pattern matchExpression
      Regular expression to apply for acceptance testing.
  • Constructor Details

    • AttributePredicate

      public AttributePredicate()
  • Method Details

    • setPromptedAttributeIds

      public void setPromptedAttributeIds(@Nullable @NonnullElements Collection<String> prompted)
      Set the attribute IDs for which to prompt for consent.
      prompted - prompted attribute IDs
    • setIgnoredAttributeIds

      public void setIgnoredAttributeIds(@Nullable @NonnullElements Collection<String> ignored)
      Set the attribute IDs to ignore for consent.
      ignored - ignored attribute IDs
    • setAttributeIdMatchExpression

      public void setAttributeIdMatchExpression(@Nullable Pattern expression)
      Set an attribute ID matching expression to apply for acceptance.
      expression - an attribute ID matching expression
    • test

      public boolean test(@Nullable IdPAttribute input)
      Specified by:
      test in interface Predicate<IdPAttribute>
    • isEmpty

      private boolean isEmpty(@Nonnull IdPAttribute input)
      Whether the IdP attribute is empty.
      input - the IdP Attribute
      true if the IdP attribute has no values or empty values, false otherwise