Class FuzzyMethodContract
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember<MethodInfo>
com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract
- All Implemented Interfaces:
AbstractFuzzyMatcher<MethodInfo>
Represents a contract for matching methods or constructors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a builder for a fuzzy method contract. -
Field Summary
Fields inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember
declaringMatcher, modifiersBanned, modifiersRequired, nameRegex, sealed -
Method Summary
Modifier and TypeMethodDescriptionList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> Retrieve an immutable list of every exception matcher for this method.Generate a view of this matcher as a key-value map.Retrieve the expected parameter count for this method.com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> Retrieve an immutable list of every parameter matcher for this method.Retrieve the class matcher for the return type.booleanisMatch(MethodInfo value, Object parent) Determine if the given value is a match.static FuzzyMethodContract.BuilderReturn a method contract builder.Methods inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember
equals, getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, hashCode, prepareBuild, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher
and, inverted, or
-
Method Details
-
newBuilder
Return a method contract builder.- Returns:
- Method contract builder.
-
getReturnMatcher
Retrieve the class matcher for the return type.- Returns:
- Class matcher for the return type.
-
getParamMatchers
public com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getParamMatchers()Retrieve an immutable list of every parameter matcher for this method.- Returns:
- Immutable list of every parameter matcher.
-
getExceptionMatchers
public List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getExceptionMatchers()Retrieve an immutable list of every exception matcher for this method.- Returns:
- Immutable list of every exception matcher.
-
getParamCount
Retrieve the expected parameter count for this method.- Returns:
- Expected parameter count, or NULL if anyting goes.
-
isMatch
Description copied from interface:AbstractFuzzyMatcherDetermine if the given value is a match.- Specified by:
isMatchin interfaceAbstractFuzzyMatcher<MethodInfo>- Overrides:
isMatchin classAbstractFuzzyMember<MethodInfo>- Parameters:
value- - the value to match.parent- - the parent container, or NULL if this value is the root.- Returns:
- TRUE if it is a match, FALSE otherwise.
-
getKeyValueView
Description copied from class:AbstractFuzzyMemberGenerate a view of this matcher as a key-value map.Used by
AbstractFuzzyMember.toString()to print a representation of this object.- Overrides:
getKeyValueViewin classAbstractFuzzyMember<MethodInfo>- Returns:
- A modifiable key-value view.
-