Class FuzzyMatchers
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.FuzzyMatchers
Contains factory methods for matching classes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractFuzzyMatcher<Class<?>> and(AbstractFuzzyMatcher<Class<?>>... matchers) static AbstractFuzzyMatcher<Class<?>> assignable(Class<?> clazz) static AbstractFuzzyMatcher<Class<?>> static AbstractFuzzyMatcher<Class<?>> matchAll()Retrieve a fuzzy matcher that will match any class.static AbstractFuzzyMatcher<Class<?>> matchAnyOf(Class<?>... classes) Construct a class matcher that matches any of the given classes exactly.static AbstractFuzzyMatcher<Class<?>> matchAnyOf(Set<Class<?>> classes) Construct a class matcher that matches any of the given classes exactly.static AbstractFuzzyMatcher<Class<?>> matchArray(AbstractFuzzyMatcher<Class<?>> componentMatcher) Construct a class matcher that matches an array with a given component matcher.static AbstractFuzzyMatcher<Class<?>> matchDerived(Class<?> matcher) Construct a class matcher that matches derived types of the given class.static AbstractFuzzyMatcher<Class<?>> matchExact(Class<?> matcher) Construct a class matcher that matches types exactly.static AbstractFuzzyMatcher<Class<?>> matchRegex(String regex) Construct a class matcher based on the canonical names of classes.static AbstractFuzzyMatcher<Class<?>> matchRegex(Pattern regex) Construct a class matcher based on the canonical names of classes.static AbstractFuzzyMatcher<Class<?>> matchSuper(Class<?> matcher) Construct a class matcher that matches super types of the given class.
-
Method Details
-
matchArray
public static AbstractFuzzyMatcher<Class<?>> matchArray(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.
-
except
-
assignable
-
and
@SafeVarargs public static AbstractFuzzyMatcher<Class<?>> and(AbstractFuzzyMatcher<Class<?>>... matchers) -
matchAll
Retrieve a fuzzy matcher that will match any class.- Returns:
- A class matcher.
-
matchExact
Construct a class matcher that matches types exactly.- Parameters:
matcher- - the matching class.- Returns:
- A new class matcher.
-
matchAnyOf
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
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
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
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
Construct a class matcher based on the canonical names of classes.- Parameters:
regex- - regular expression pattern matching class names.- Returns:
- A fuzzy class matcher based on name.
-
matchRegex
Construct a class matcher based on the canonical names of classes.- Parameters:
regex- - regular expression matching class names.- Returns:
- A fuzzy class matcher based on name.
-