Package net.shibboleth.profile.context.logic

# Class AbstractAttributePredicate

java.lang.Object
net.shibboleth.profile.context.logic.AbstractAttributePredicate

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`

Direct Known Subclasses:
  `DateAttributePredicate`, `DynamicAttributePredicate`, `RegexAttributePredicate`, `SimpleAttributePredicate`

public abstract class AbstractAttributePredicate extends Object implements Predicate<ProfileRequestContext>
Abstract base class for predicates operating on an `AttributeContext`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextLookupStrategy`
Strategy function to lookup `AttributeContext`.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`useUnfilteredAttributes`
Whether to look at filtered or unfiltered attributes.

## Constructor Summary

Constructors
Constructor
Description
`AbstractAttributePredicate()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`allowNullAttributeContext()`
Get the result of the predicate in the case the attribute context is null.
`Function<ProfileRequestContext,AttributeContext>`
`getAttributeContextLookupStrategy()`
Get the lookup strategy to use to locate the `AttributeContext`.
`protected abstract boolean`
`hasMatch(Map<String,IdPAttribute> attributeMap)`
Abstract implementation of the condition to evaluate.
`boolean`
`isUseUnfilteredAttributes()`
Get whether to source the input attributes from the unfiltered set.
`void`
`setAttributeContextLookupStrategy(Function<ProfileRequestContext,AttributeContext> strategy)`
Set the lookup strategy to use to locate the `AttributeContext`.
`void`
`setUseUnfilteredAttributes(boolean flag)`
Set whether to source the input attributes from the unfiltered set.
`boolean`
`test(ProfileRequestContext input)`

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

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### attributeContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
Strategy function to lookup `AttributeContext`.

### useUnfilteredAttributes

private boolean useUnfilteredAttributes
Whether to look at filtered or unfiltered attributes.

## Constructor Details

### AbstractAttributePredicate

public AbstractAttributePredicate()
Constructor.

## Method Details

### getAttributeContextLookupStrategy

@Nonnull public Function<ProfileRequestContext,AttributeContext> getAttributeContextLookupStrategy()
Get the lookup strategy to use to locate the `AttributeContext`.

Returns:
  lookup strategy to use

### setAttributeContextLookupStrategy

public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
Set the lookup strategy to use to locate the `AttributeContext`.

Parameters:
  `strategy` - lookup function to use

### isUseUnfilteredAttributes

public boolean isUseUnfilteredAttributes()
Get whether to source the input attributes from the unfiltered set.

Returns:
  whether to source the input attributes from the unfiltered set

### setUseUnfilteredAttributes

public void setUseUnfilteredAttributes(boolean flag)
Set whether to source the input attributes from the unfiltered set.

Defaults to true.

Parameters:
  `flag` - flag to set

### test

public boolean test(@Nullable ProfileRequestContext input)

Specified by:
  `test` in interface `Predicate<ProfileRequestContext>`

### allowNullAttributeContext

protected boolean allowNullAttributeContext()
Get the result of the predicate in the case the attribute context is null.

Defaults to false unless overridden by a subclass.

Returns:
  null context result

### hasMatch

protected abstract boolean hasMatch(@Nonnull Map<String,IdPAttribute> attributeMap)
Abstract implementation of the condition to evaluate.

Parameters:
  `attributeMap` - the attributes to evaluate
Returns:
  the condition result