Package net.shibboleth.idp.attribute.filter

# Class MatcherFromPolicy

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.BaseBridgingClass
net.shibboleth.idp.attribute.filter.MatcherFromPolicy

All Implemented Interfaces:
  `Matcher`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

public final class MatcherFromPolicy extends BaseBridgingClass implements Matcher, IdentifiedComponent, DestructableComponent
Bridging class to go from a `PolicyRequirementRule` to a `Matcher`.

If the rule is true then we return all values, else we return none. If the rule fails we return null.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private final PolicyRequirementRule`
`rule`
The rule we are shadowing.

### Fields inherited from interface net.shibboleth.idp.attribute.filter.Matcher

`MATCHER_FAILS, MATCHES_ALL, MATCHES_NONE`

## Constructor Summary

Constructors
Constructor
Description
`MatcherFromPolicy(PolicyRequirementRule theRule)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Set<IdPAttributeValue>`
`getMatchingValues(IdPAttribute attribute, AttributeFilterContext filterContext)`
Return those `IdPAttributeValue`s which match this rule, or null if the matcher failed.
`PolicyRequirementRule`
`getPolicyRequirementRule()`
Testing support.

### Methods inherited from class net.shibboleth.idp.attribute.filter.BaseBridgingClass

`doDestroy, doInitialize, getLogPrefix`

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

`setId`

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

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

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

`checkComponentActive, checkSetterPreconditions, destroy, 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 net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiableComponent

`setId`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Field Details

### rule

@Nonnull private final PolicyRequirementRule rule
The rule we are shadowing.

### log

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

## Constructor Details

### MatcherFromPolicy

public MatcherFromPolicy(@Nonnull @ParameterName(name="theRule") PolicyRequirementRule theRule)
Constructor.

Parameters:
  `theRule` - the class we are bridging to

## Method Details

### getPolicyRequirementRule

@Nonnull public PolicyRequirementRule getPolicyRequirementRule()
Testing support. Get the embedded PolicyRequirementRule.

Returns:
  the embedded matcher.

### getMatchingValues

@Nullable public Set<IdPAttributeValue> getMatchingValues(@Nonnull IdPAttribute attribute, @Nonnull AttributeFilterContext filterContext)
Return those `IdPAttributeValue`s which match this rule, or null if the matcher failed.

Specified by:
  `getMatchingValues` in interface `Matcher`
Parameters:
  `attribute` - the attribute under question.
  `filterContext` - the filter context
Returns:
  The result of this rule. Null if we failed.