public class FuzzyFieldContract extends AbstractFuzzyMember<java.lang.reflect.Field>
Modifier and Type | Class and Description |
---|---|
static class |
FuzzyFieldContract.Builder
Represents a builder for a field matcher.
|
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) |
protected java.util.Map<java.lang.String,java.lang.Object> |
getKeyValueView()
Generate a view of this matcher as a key-value map.
|
AbstractFuzzyMatcher<java.lang.Class<?>> |
getTypeMatcher()
Retrieve the class matcher that matches the type of a field.
|
int |
hashCode() |
boolean |
isMatch(java.lang.reflect.Field value,
java.lang.Object parent)
Determine if the given value is a match.
|
static FuzzyFieldContract |
matchType(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
Match a field by its type.
|
static FuzzyFieldContract.Builder |
newBuilder()
Return a new fuzzy field contract builder.
|
getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, prepareBuild, toString
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
public static FuzzyFieldContract matchType(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
matcher
- - the type to match.public static FuzzyFieldContract.Builder newBuilder()
public AbstractFuzzyMatcher<java.lang.Class<?>> getTypeMatcher()
public boolean isMatch(java.lang.reflect.Field value, java.lang.Object parent)
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMember<java.lang.reflect.Field>
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<java.lang.reflect.Field>
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<java.lang.reflect.Field>
public int hashCode()
hashCode
in class AbstractFuzzyMember<java.lang.reflect.Field>
public boolean equals(java.lang.Object obj)
equals
in class AbstractFuzzyMember<java.lang.reflect.Field>