> For the complete documentation index, see [llms.txt](https://sacro.gitbook.io/syllabore/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sacro.gitbook.io/syllabore/class-docs/namefilter.md).

# NameFilter

Validates names produced by a name generator against a set of configurable constraints.

*Implements:* [*INameFilter*](/syllabore/class-docs/inamefilter.md)

## Constructors

| Constructor  | Description                                                                               |
| ------------ | ----------------------------------------------------------------------------------------- |
| NameFilter() | Instantiates a new [NameFilter](/syllabore/class-docs/namefilter.md) with no constraints. |

## Methods

| Method                                                                        | Returns                                           | Description                                                                                            |
| ----------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Add(System.String\[] patterns)                                                | [NameFilter](/syllabore/class-docs/namefilter.md) | Adds new patterns to this filter.                                                                      |
| Add([FilterConstraint](/syllabore/class-docs/filterconstraint.md) constraint) | [NameFilter](/syllabore/class-docs/namefilter.md) | Adds a new constraint to this filter.                                                                  |
| IsValid([Name](/syllabore/class-docs/name.md) name)                           | System.Boolean                                    | Returns true if the specified name does not match any of this filter's contraints, else returns false. |
| IsValid(System.String name)                                                   | System.Boolean                                    | Returns true if the specified name does not match any of this filter's contraints, else returns false. |

## Properties

| Property    | Type                                                                                            | Description                                                          |
| ----------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| Constraints | System.Collections.Generic.List <[FilterConstraint](/syllabore/class-docs/filterconstraint.md)> | The list of constraints that names must pass to be considered valid. |
