Class FuzzyFieldContract
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher<T>
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember<Field>
com.comphenix.protocol.reflect.fuzzy.FuzzyFieldContract
- All Implemented Interfaces:
Comparable<AbstractFuzzyMatcher<Field>>
Represents a field matcher.
- Author:
- Kristian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a builder for a field matcher. -
Field Summary
Fields inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember
declaringMatcher, modifiersBanned, modifiersRequired, nameRegex, sealed -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculate the round number indicating when this matcher should be applied.booleanGenerate a view of this matcher as a key-value map.Retrieve the class matcher that matches the type of a field.inthashCode()booleanDetermine if the given value is a match.static FuzzyFieldContractmatchType(AbstractFuzzyMatcher<Class<?>> matcher)Match a field by its type.static FuzzyFieldContract.BuilderReturn a new fuzzy field contract builder.Methods inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember
getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, prepareBuild, toStringMethods inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
-
Method Details
-
matchType
Match a field by its type.- Parameters:
matcher- - the type to match.- Returns:
- The field contract.
-
newBuilder
Return a new fuzzy field contract builder.- Returns:
- New fuzzy field contract builder.
-
getTypeMatcher
Retrieve the class matcher that matches the type of a field.- Returns:
- The class matcher.
-
isMatch
Description copied from class:AbstractFuzzyMatcherDetermine if the given value is a match.- Overrides:
isMatchin classAbstractFuzzyMember<Field>- 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.- Overrides:
calculateRoundNumberin classAbstractFuzzyMember<Field>- Returns:
- A number (positive or negative) that is used to order matchers.
-
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<Field>- Returns:
- A modifiable key-value view.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractFuzzyMember<Field>
-
equals
- Overrides:
equalsin classAbstractFuzzyMember<Field>
-