public class FuzzyMethodContract extends AbstractFuzzyMember<MethodInfo>
Modifier and Type | Class and Description |
---|---|
static class |
FuzzyMethodContract.Builder
Represents a builder for a fuzzy method contract.
|
declaringMatcher, modifiersBanned, modifiersRequired, nameRegex, sealed
Modifier and Type | Method and Description |
---|---|
protected int |
calculateRoundNumber()
Calculate the round number indicating when this matcher should be applied.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> |
getExceptionMatchers()
Retrieve an immutable list of every exception matcher for this method.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getKeyValueView()
Generate a view of this matcher as a key-value map.
|
java.lang.Integer |
getParamCount()
Retrieve the expected parameter count for this method.
|
com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> |
getParamMatchers()
Retrieve an immutable list of every parameter matcher for this method.
|
AbstractFuzzyMatcher<java.lang.Class<?>> |
getReturnMatcher()
Retrieve the class matcher for the return type.
|
int |
hashCode() |
boolean |
isMatch(MethodInfo value,
java.lang.Object parent)
Determine if the given value is a match.
|
static FuzzyMethodContract.Builder |
newBuilder()
Return a method contract builder.
|
protected void |
prepareBuild()
Called before a builder is building a member and copying its state.
|
getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, toString
and, combineRounds, compareTo, getRoundNumber, inverted, or
public static FuzzyMethodContract.Builder newBuilder()
public AbstractFuzzyMatcher<java.lang.Class<?>> getReturnMatcher()
public com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getParamMatchers()
public java.util.List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getExceptionMatchers()
public java.lang.Integer getParamCount()
protected void prepareBuild()
AbstractFuzzyMember
Use this to prepare any special values.
prepareBuild
in class AbstractFuzzyMember<MethodInfo>
public boolean isMatch(MethodInfo value, java.lang.Object parent)
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMember<MethodInfo>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.protected int calculateRoundNumber()
AbstractFuzzyMatcher
Matchers with a lower round number are applied before matchers with a higher round number.
By convention, this round number should be negative, except for zero in the case of a matcher
that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
of the least specified type used in the matching. Thus Integer
will have a lower round number than
Number
.
calculateRoundNumber
in class AbstractFuzzyMember<MethodInfo>
protected java.util.Map<java.lang.String,java.lang.Object> getKeyValueView()
AbstractFuzzyMember
Used by AbstractFuzzyMember.toString()
to print a representation of this object.
getKeyValueView
in class AbstractFuzzyMember<MethodInfo>
public int hashCode()
hashCode
in class AbstractFuzzyMember<MethodInfo>
public boolean equals(java.lang.Object obj)
equals
in class AbstractFuzzyMember<MethodInfo>