Package net.shibboleth.profile.context.logic

# Class RegexAttributePredicate

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

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`

public class RegexAttributePredicate extends AbstractAttributePredicate
Predicate that evaluates an `AttributeContext` and checks a specific attribute for value(s) that match a regular expression.

This handles only simple string-valued data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`attributeId`
The attribute to evaluate.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Pattern`
`pattern`
Regular expression.

## Constructor Summary

Constructors
Constructor
Description
`RegexAttributePredicate()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getAttributeId()`
Get the attribute ID to check.
`Pattern`
`getPattern()`
Get the pattern to match the attribute values against.
`protected boolean`
`hasMatch(Map<String,IdPAttribute> attributeMap)`
Abstract implementation of the condition to evaluate.
`void`
`setAttributeId(String id)`
Set the attribute ID to check.
`void`
`setPattern(String s)`
Set the pattern to match the attribute values against.
`void`
`setPattern(Pattern p)`
Set the pattern to match the attribute values against.

### Methods inherited from class net.shibboleth.profile.context.logic.AbstractAttributePredicate

`allowNullAttributeContext, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes, test`

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

### attributeId

@Nullable @NotEmpty private String attributeId
The attribute to evaluate.

### pattern

@Nullable private Pattern pattern
Regular expression.

## Constructor Details

### RegexAttributePredicate

public RegexAttributePredicate()

## Method Details

### getAttributeId

@Nullable @NotEmpty public String getAttributeId()
Get the attribute ID to check.

Returns:
  the attribute ID to check

### setAttributeId

public void setAttributeId(@Nonnull @NotEmpty String id)
Set the attribute ID to check.

Parameters:
  `id` - the attribute ID to check

### getPattern

@Nullable public Pattern getPattern()
Get the pattern to match the attribute values against.

Returns:
  the pattern to match the attribute values against

### setPattern

public void setPattern(@Nonnull Pattern p)
Set the pattern to match the attribute values against.

Parameters:
  `p` - the pattern to match the attribute values against

### setPattern

public void setPattern(@Nonnull @NotEmpty String s)
Set the pattern to match the attribute values against.

Parameters:
  `s` - the pattern to match the attribute values against

### hasMatch

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

Specified by:
  `hasMatch` in class `AbstractAttributePredicate`
Parameters:
  `attributeMap` - the attributes to evaluate
Returns:
  the condition result