Package net.shibboleth.idp.attribute.filter

# Class PolicyFromMatcherId

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

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

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

If the value of the supplied attribute matches then this is true, otherwise false.

## Nested Class Summary

## Nested classes/interfaces inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule

`PolicyRequirementRule.Tristate`

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String`
`attributeId`
The attribute Id we care about.
`private final org.slf4j.Logger`
`log`
Class logger.
`private final Matcher`
`theMatcher`
The rule we are shadowing.

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

`MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS`

## Constructor Summary

Constructors
Constructor
Description
`PolicyFromMatcherId(Matcher matcher, String attribute)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAttributeId()`
Gets the Id of the attribute in question.
`Matcher`
`getMatcher()`
Testing support.
`PolicyRequirementRule.Tristate`
`matches(AttributeFilterContext context)`
Evaluate what this rule means.

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

### theMatcher

@Nonnull private final Matcher theMatcher
The rule we are shadowing.

### attributeId

@Nonnull @NotEmpty private final String attributeId
The attribute Id we care about.

### log

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

## Constructor Details

### PolicyFromMatcherId

public PolicyFromMatcherId(@Nonnull @ParameterName(name="matcher") Matcher matcher, @Nonnull @NotEmpty @ParameterName(name="attribute") String attribute)
Constructor.

Parameters:
  `matcher` - the class we are bridging to
  `attribute` - the Id of the attribute in question.

## Method Details

### getAttributeId

@Nonnull public String getAttributeId()
Gets the Id of the attribute in question.

Returns:
  the id.

### getMatcher

@Nonnull public Matcher getMatcher()
Testing support. Get the embedded matcher.

Returns:
  the embedded matcher.

### matches

@Nonnull public PolicyRequirementRule.Tristate matches(@Nonnull AttributeFilterContext context)
Evaluate what this rule means.

Specified by:
  `matches` in interface `PolicyRequirementRule`
Parameters:
  `context` - the context.
Returns:
  whether the rule holds