org.apache.commons.io.serialization

## Class RegexpClassNameMatcher

- java.lang.Object
- - org.apache.commons.io.serialization.RegexpClassNameMatcher

- All Implemented Interfaces:
    ClassNameMatcher

      final class RegexpClassNameMatcher
      extends Object
      implements ClassNameMatcher

  A `ClassNameMatcher` that uses regular expressions.

  This object is immutable and thread-safe.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegexpClassNameMatcher(Pattern pattern)` Constructs an object based on the specified pattern.
    `RegexpClassNameMatcher(String regex)` Constructs an object based on the specified regular expression.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `matches(String className)` Returns `true` if the supplied class name matches this object's condition.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RegexpClassNameMatcher

          RegexpClassNameMatcher(Pattern pattern)

      Constructs an object based on the specified pattern.
      Parameters:
        `pattern` - a pattern for evaluating acceptable class names
      Throws:
        `NullPointerException` - if `pattern` is null

    - #### RegexpClassNameMatcher

          RegexpClassNameMatcher(String regex)

      Constructs an object based on the specified regular expression.
      Parameters:
        `regex` - a regular expression for evaluating acceptable class names

  - ### Method Detail

    - #### matches

          public boolean matches(String className)

      Description copied from interface: `ClassNameMatcher`
      Returns `true` if the supplied class name matches this object's condition.
      Specified by:
        `matches` in interface `ClassNameMatcher`
      Parameters:
        `className` - fully qualified class name
      Returns:
        `true` if the class name matches this object's condition