Package net.shibboleth.idp.attribute.filter.testing

# Class MockPolicyRequirementRule

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.idp.attribute.filter.testing.MockPolicyRequirementRule

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

public class MockPolicyRequirementRule extends AbstractIdentifiedInitializableComponent implements PolicyRequirementRule
A simple, mock implementation of `Matcher`.

## 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 boolean`
`initialized`
state variable
`private PolicyRequirementRule.Tristate`
`retVal`
to return from matcher().

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

`MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS`

## Constructor Summary

Constructors
Constructor
Description
`MockPolicyRequirementRule()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`doInitialize()`
`boolean`
`isInitialized()`
`PolicyRequirementRule.Tristate`
`matches(AttributeFilterContext filterContext)`
Evaluate what this rule means.
`void`
`setRetVal(PolicyRequirementRule.Tristate what)`
Set what to return

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

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, setId`

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

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed`

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

`getId`

## Field Details

### initialized

private boolean initialized
state variable

### retVal

@Nullable private PolicyRequirementRule.Tristate retVal
to return from matcher().

## Constructor Details

### MockPolicyRequirementRule

public MockPolicyRequirementRule()
Constructor.

## Method Details

### isInitialized

public boolean isInitialized()

Specified by:
  `isInitialized` in interface `InitializableComponent`
Overrides:
  `isInitialized` in class `AbstractInitializableComponent`

### doInitialize

public void doInitialize()

Overrides:
  `doInitialize` in class `AbstractIdentifiedInitializableComponent`

### setRetVal

public void setRetVal(PolicyRequirementRule.Tristate what)
Set what to return

Parameters:
  `what` - what to return

### matches

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

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