Class FuzzyMatchers

java.lang.Object
com.comphenix.protocol.reflect.fuzzy.FuzzyMatchers

public class FuzzyMatchers extends Object
Contains factory methods for matching classes.
Author:
Kristian
  • Method Details

    • matchArray

      public static AbstractFuzzyMatcher<Class<?>> matchArray(@Nonnull AbstractFuzzyMatcher<Class<?>> componentMatcher)
      Construct a class matcher that matches an array with a given component matcher.
      Parameters:
      componentMatcher - - the component matcher.
      Returns:
      A new array matcher.
    • matchAll

      public static AbstractFuzzyMatcher<Class<?>> matchAll()
      Retrieve a fuzzy matcher that will match any class.
      Returns:
      A class matcher.
    • matchExact

      public static AbstractFuzzyMatcher<Class<?>> matchExact(Class<?> matcher)
      Construct a class matcher that matches types exactly.
      Parameters:
      matcher - - the matching class.
      Returns:
      A new class matcher.
    • matchAnyOf

      public static AbstractFuzzyMatcher<Class<?>> matchAnyOf(Class<?>... classes)
      Construct a class matcher that matches any of the given classes exactly.
      Parameters:
      classes - - list of classes to match.
      Returns:
      A new class matcher.
    • matchAnyOf

      public static AbstractFuzzyMatcher<Class<?>> matchAnyOf(Set<Class<?>> classes)
      Construct a class matcher that matches any of the given classes exactly.
      Parameters:
      classes - - set of classes to match.
      Returns:
      A new class matcher.
    • matchSuper

      public static AbstractFuzzyMatcher<Class<?>> matchSuper(Class<?> matcher)
      Construct a class matcher that matches super types of the given class.
      Parameters:
      matcher - - the matching type must be a super class of this type.
      Returns:
      A new class matcher.
    • matchDerived

      public static AbstractFuzzyMatcher<Class<?>> matchDerived(Class<?> matcher)
      Construct a class matcher that matches derived types of the given class.
      Parameters:
      matcher - - the matching type must be a derived class of this type.
      Returns:
      A new class matcher.
    • matchRegex

      public static AbstractFuzzyMatcher<Class<?>> matchRegex(Pattern regex, int priority)
      Construct a class matcher based on the canonical names of classes.
      Parameters:
      regex - - regular expression pattern matching class names.
      priority - - the priority this matcher takes - higher is better.
      Returns:
      A fuzzy class matcher based on name.
    • matchRegex

      public static AbstractFuzzyMatcher<Class<?>> matchRegex(String regex, int priority)
      Construct a class matcher based on the canonical names of classes.
      Parameters:
      regex - - regular expression matching class names.
      priority - - the priority this matcher takes - higher is better.
      Returns:
      A fuzzy class matcher based on name.
    • matchParent

      public static AbstractFuzzyMatcher<Class<?>> matchParent()
      Match the parent class of a method, field or constructor.
      Returns:
      Parent matcher.