Package: groovy.org.codenarc.ruleset

## [Groovy] Class FilteredRuleSet

- groovy.org.codenarc.ruleset.FilteredRuleSet

- All Implemented Interfaces and Traits:
    RuleSet

      class FilteredRuleSet

  A `RuleSet` implementation that is a Decorator for another RuleSet, but provides the ability to filter included and excluded rules within that RuleSet.

  If a Rule matches both an include and an exclude, then the exclude takes precedence, i.e. the Rule is NOT includes in the result from `getRules()`.

  Authors:
    Chris Mair

- - ### Constructor Summary

    Constructors
    Constructor and description
    `FilteredRuleSet (RuleSet ruleSet)` Construct a new instance on the specified RuleSet

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addExclude(String exclude)` Add an exclude criteria.
    `` | `void` | `addInclude(String include)` Add an include criteria.
    `` | `List` | `getRules()` Return the List of Rules that match the include(s) (if specified) AND DO NOT match any exlcude(s) specified.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FilteredRuleSet(RuleSet ruleSet)

      Construct a new instance on the specified RuleSet

      Parameters:
        `ruleset` - - the RuleSet to be filtered (decorated); must not be null.

  - ### Method Detail

    - #### void addExclude(String exclude)

      Add an exclude criteria.

      Parameters:
        `exclude` - - the exclude specification, which is compared against the ids of all of the Rules within the underlying RuleSet. Any matching Rules are excluded in the result from `getRules()`. The `exclude` value must not be null or empty.

    - #### void addInclude(String include)

      Add an include criteria.

      Parameters:
        `include` - - the include specification, which is compared against the ids of all of the Rules within the underlying RuleSet. Only matching Rules are included in the result from `getRules()`. The `include` value must not be null or empty.

    - #### List getRules()

      Return the List of Rules that match the include(s) (if specified) AND DO NOT match any exlcude(s) specified.

      Returns:
        the filtered List of Rule objects. The returned List is immutable.