de.caff.util

## Class GlobMatcher

- java.lang.Object
- - de.caff.util.GlobMatcher

-     public class GlobMatcher
      extends java.lang.Object

  This class handles simple glob matching:
  - `*` stands for any number of chars (including zero)
  - `?` stands for exactly one char
  - `[AX-Z]` stands for characters `A`, `X`, `Y` and `Z`
  - `[^AX-Z]` stands for all characters but `A`, `X`, `Y` and `Z`
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GlobMatcher(java.lang.String pattern)` Constructor.
    `GlobMatcher(java.lang.String pattern, boolean caseInsensitive)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Predicate1<java.lang.String>` | `asPredicate()` Get this matcher as a predicate.
    `boolean` | `equals(java.lang.Object o)`
    `int` | `getCardinality()` Get the cardinality of this matcher.
    `java.lang.String` | `getPattern()` Get the pattern.
    `int` | `hashCode()`
    `boolean` | `hasWildCards()` Is this glob matcher using wildcards?
    `boolean` | `isMatching(java.lang.String str)` Is a given string matching this pattern?
    `static void` | `main(java.lang.String[] args)`
    `java.lang.String` | `toString()` Returns a string representation of the object.
    `static GlobMatcher` | `whenUsingGlobbing(java.lang.String pattern, boolean caseInsensitive)` Get a matcher if the given pattern uses globbing.

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GlobMatcher

          public GlobMatcher(@NotNull
                             java.lang.String pattern)

      Constructor. This will construct a case-sensitive matcher.
      Parameters:
        `pattern` - pattern

    - #### GlobMatcher

          public GlobMatcher(@NotNull
                             java.lang.String pattern,
                             boolean caseInsensitive)

      Constructor.
      Parameters:
        `pattern` - pattern
        `caseInsensitive` - make the matcher case-insensitive?

  - ### Method Detail

    - #### getPattern

          @NotNull
          public java.lang.String getPattern()

      Get the pattern.
      Returns:
        the underlying pattern

    - #### getCardinality

          public int getCardinality()

      Get the cardinality of this matcher. The cardinality describes the number of different match areas.
      Returns:
        the cardinality

    - #### hasWildCards

          public boolean hasWildCards()

      Is this glob matcher using wildcards?
      Returns:
        the answer

    - #### asPredicate

          @NotNull
          public Predicate1<java.lang.String> asPredicate()

      Get this matcher as a predicate.
      Returns:
        predicate returning `true` if this pattern matches

    - #### whenUsingGlobbing

          @Nullable
          public static GlobMatcher whenUsingGlobbing(@NotNull
                                                                java.lang.String pattern,
                                                                boolean caseInsensitive)

      Get a matcher if the given pattern uses globbing.
      Parameters:
        `pattern` - the pattern
        `caseInsensitive` - make the matcher case-insensitive
      Returns:
        a matcher for the given pattern, or `null` if the string does not contain wildcards

    - #### isMatching

          public boolean isMatching(@NotNull
                                    java.lang.String str)

      Is a given string matching this pattern?
      Parameters:
        `str` - the string
      Returns:
        `true` if the string is matching, `false` otherwise

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Returns a string representation of the object.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the object.

    - #### main

          public static void main(@NotNull
                                  java.lang.String[] args)