Class HookMatcher

java.lang.Object
com.tnsai.server.hooks.HookMatcher

public final class HookMatcher extends Object
Matches tool names against a pattern. Supports:
  • Exact match: "shell"
  • Glob wildcard: "file_*", "*_write", "*"

Matching is case-insensitive using Locale.ROOT.

  • Field Details

    • ALL

      public static final HookMatcher ALL
      Matches all tools.
  • Constructor Details

    • HookMatcher

      public HookMatcher(String pattern)
  • Method Details

    • matches

      public boolean matches(String toolName)
      Returns true if the given tool name matches this pattern.
    • pattern

      public String pattern()
    • toString

      public String toString()
      Overrides:
      toString in class Object