Class GlobMatcher

java.lang.Object
org.infinispan.commons.util.GlobMatcher

public final class GlobMatcher extends Object
A matcher for glob patterns.

Matches the glob pattern without transforming into a Pattern. Otherwise, it is possible to convert with GlobUtils.globToRegex(String).

Since:
15.0
Author:
José Bolina
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    match(byte[] pattern, byte[] string)
    Checks whether the given byte sequence matches the glob pattern describe as a byte sequence.
    static boolean
    match(String pattern, String string)
    Checks whether the given string matches the glob pattern.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • match

      public static boolean match(String pattern, String string)
      Checks whether the given string matches the glob pattern.

      Warning: This methods does not accept multi-byte strings.

      Parameters:
      pattern - : Glob pattern to check against.
      string - : String to check for matching.
      Returns:
      true if a match is found, false, otherwise.
    • match

      public static boolean match(byte[] pattern, byte[] string)
      Checks whether the given byte sequence matches the glob pattern describe as a byte sequence.

      Warning: This method does not accept multi-byte characters.

      Parameters:
      pattern - : The glob pattern represented as a byte sequence.
      string - : The string represented as a byte sequence.
      Returns:
      true if a match is found, false, otherwise.