Class 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.
  • 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.