Package net.shibboleth.idp.consent.logic.impl

# Class AttributePredicate

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.consent.logic.impl.AttributePredicate

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

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

## Field Summary

Fields
Modifier and Type
Field
Description
`private Set<String>`
`ignoredAttributeIds`
Set of attribute IDs to ignore for consent.
`private Pattern`
`matchExpression`
Regular expression to apply for acceptance testing.
`private Set<String>`
`promptedAttributeIds`
Set of attribute IDs for which to prompt for consent.

## Constructor Summary

Constructors
Constructor
Description
`AttributePredicate()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private boolean`
`isEmpty(IdPAttribute input)`
Whether the IdP attribute is empty.
`void`
`setAttributeIdMatchExpression(Pattern expression)`
Set an attribute ID matching expression to apply for acceptance.
`void`
`setIgnoredAttributeIds(Collection<String> ignored)`
Set the attribute IDs to ignore for consent.
`void`
`setPromptedAttributeIds(Collection<String> prompted)`
Set the attribute IDs for which to prompt for consent.
`boolean`
`test(IdPAttribute input)`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### 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.Predicate

`and, negate, or`

## Field Details

### promptedAttributeIds

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

### ignoredAttributeIds

@Nonnull 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()
Constructor.

## Method Details

### setPromptedAttributeIds

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

Parameters:
  `prompted` - prompted attribute IDs

### setIgnoredAttributeIds

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

Parameters:
  `ignored` - ignored attribute IDs

### setAttributeIdMatchExpression

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

Parameters:
  `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.

Parameters:
  `input` - the IdP Attribute
Returns:
  true if the IdP attribute has no values or empty values, false otherwise