Class AbstractFuzzyMember<T extends Member>
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher<T>
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember<T>
- Type Parameters:
T- - type that it matches.
- All Implemented Interfaces:
Comparable<AbstractFuzzyMatcher<T>>
- Direct Known Subclasses:
FuzzyFieldContract,FuzzyMethodContract
Represents a matcher that matches members.
- Author:
- Kristian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>Represents a builder of a fuzzy member contract. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractFuzzyMatcher<Class<?>>protected intprotected intprotected Patternprotected booleanWhether or not this contract can be modified. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractFuzzyMember(AbstractFuzzyMember<T> other) -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculate the round number indicating when this matcher should be applied.booleanRetrieve a class matcher for the declaring class of the member.Generate a view of this matcher as a key-value map.intRetrieve a bit field of everyModifierthat must not be present for the member to match.intRetrieve a bit field of everyModifierthat is required for the member to match.Retrieve the regular expression pattern that is used to match the name of a member.inthashCode()booleanDetermine if the given value is a match.protected voidCalled before a builder is building a member and copying its state.toString()Methods inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
-
Field Details
-
modifiersRequired
protected int modifiersRequired -
modifiersBanned
protected int modifiersBanned -
nameRegex
-
declaringMatcher
-
sealed
protected transient boolean sealedWhether or not this contract can be modified.
-
-
Constructor Details
-
AbstractFuzzyMember
protected AbstractFuzzyMember() -
AbstractFuzzyMember
-
-
Method Details
-
prepareBuild
protected void prepareBuild()Called before a builder is building a member and copying its state.Use this to prepare any special values.
-
getModifiersRequired
public int getModifiersRequired()Retrieve a bit field of everyModifierthat is required for the member to match.- Returns:
- A required modifier bit field.
-
getModifiersBanned
public int getModifiersBanned()Retrieve a bit field of everyModifierthat must not be present for the member to match.- Returns:
- A banned modifier bit field.
-
getNameRegex
Retrieve the regular expression pattern that is used to match the name of a member.- Returns:
- The regex matching a name, or NULL if everything matches.
-
getDeclaringMatcher
Retrieve a class matcher for the declaring class of the member.- Returns:
- An object matching the declaring class.
-
isMatch
Description copied from class:AbstractFuzzyMatcherDetermine if the given value is a match.- Specified by:
isMatchin classAbstractFuzzyMatcher<T extends Member>- 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.
-
calculateRoundNumber
protected int calculateRoundNumber()Description copied from class:AbstractFuzzyMatcherCalculate the round number indicating when this matcher should be applied.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
Integerwill have a lower round number thanNumber.- Specified by:
calculateRoundNumberin classAbstractFuzzyMatcher<T extends Member>- Returns:
- A number (positive or negative) that is used to order matchers.
-
toString
-
getKeyValueView
Generate a view of this matcher as a key-value map.Used by
toString()to print a representation of this object.- Returns:
- A modifiable key-value view.
-
equals
-
hashCode
public int hashCode()
-