Package net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl

# Class NumOfAttributeValuesPolicyRule

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.NumOfAttributeValuesPolicyRule

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

public class NumOfAttributeValuesPolicyRule extends AbstractPolicyRule
A policy rule that checks if the given attribute has more than the minimum number of values but less than the maximum.

## 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 String`
`attributeId`
ID of the attribute that will be checked.
`private final org.slf4j.Logger`
`log`
Class logger.
`private int`
`maximumValues`
Maximum allowed number of attribute values.
`private int`
`minimumValues`
Minimum allowed number of attribute values.

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

`MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS`

## Constructor Summary

Constructors
Constructor
Description
`NumOfAttributeValuesPolicyRule()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`String`
`getAttributeId()`
Return the attribute whose value count is under question.
`int`
`getMaximum()`
Return the maximum allowed number of attribute values.
`int`
`getMinimum()`
Return the minimum allowed number of attribute values.
`PolicyRequirementRule.Tristate`
`matches(AttributeFilterContext filterContext)`
Evaluate what this rule means.
`void`
`setAttributeId(String attribute)`
Set the attribute whose value count is under question.
`void`
`setMaximum(int maxValues)`
Set the maximum allowed number of attribute values.
`void`
`setMinimum(int minValues)`
Set the minimum allowed number of attribute values.

### Methods inherited from class net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule

`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, doDestroy, 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.IdentifiedComponent

`getId`

## Field Details

### log

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

### attributeId

@NonnullAfterInit private String attributeId
ID of the attribute that will be checked.

### minimumValues

private int minimumValues
Minimum allowed number of attribute values.

### maximumValues

private int maximumValues
Maximum allowed number of attribute values.

## Constructor Details

### NumOfAttributeValuesPolicyRule

public NumOfAttributeValuesPolicyRule()
Constructor.

## Method Details

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractPolicyRule`
Throws:
  `ComponentInitializationException`

### matches

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

Parameters:
  `filterContext` - the context.
Returns:
  whether the rule holds

### getAttributeId

@NonnullAfterInit public String getAttributeId()
Return the attribute whose value count is under question.

Returns:
  the attributeId.

### setAttributeId

public void setAttributeId(@Nonnull @NotEmpty String attribute)
Set the attribute whose value count is under question.

Parameters:
  `attribute` - The attributeId to set.

### getMinimum

public int getMinimum()
Return the minimum allowed number of attribute values.

Returns:
  Returns the minimumValues.

### setMinimum

public void setMinimum(int minValues)
Set the minimum allowed number of attribute values.

Parameters:
  `minValues` - The minimumValues to set.

### getMaximum

public int getMaximum()
Return the maximum allowed number of attribute values.

Returns:
  Returns the maximumValues.

### setMaximum

public void setMaximum(int maxValues)
Set the maximum allowed number of attribute values.

Parameters:
  `maxValues` - The maximumValues to set.