T
- - type that it matches.public abstract class AbstractFuzzyMember<T extends java.lang.reflect.Member> extends AbstractFuzzyMatcher<T>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
Represents a builder of a fuzzy member contract.
|
Modifier and Type | Field and Description |
---|---|
protected AbstractFuzzyMatcher<java.lang.Class<?>> |
declaringMatcher |
protected int |
modifiersBanned |
protected int |
modifiersRequired |
protected java.util.regex.Pattern |
nameRegex |
protected boolean |
sealed
Whether or not this contract can be modified.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractFuzzyMember() |
protected |
AbstractFuzzyMember(AbstractFuzzyMember<T> other) |
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) |
AbstractFuzzyMatcher<java.lang.Class<?>> |
getDeclaringMatcher()
Retrieve a class matcher for the declaring class of the member.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getKeyValueView()
Generate a view of this matcher as a key-value map.
|
int |
getModifiersBanned()
Retrieve a bit field of every
Modifier that must not be present for the member to match. |
int |
getModifiersRequired()
Retrieve a bit field of every
Modifier that is required for the member to match. |
java.util.regex.Pattern |
getNameRegex()
Retrieve the regular expression pattern that is used to match the name of a member.
|
int |
hashCode() |
boolean |
isMatch(T value,
java.lang.Object parent)
Determine if the given value is a match.
|
protected void |
prepareBuild()
Called before a builder is building a member and copying its state.
|
java.lang.String |
toString() |
and, combineRounds, compareTo, getRoundNumber, inverted, or
protected int modifiersRequired
protected int modifiersBanned
protected java.util.regex.Pattern nameRegex
protected AbstractFuzzyMatcher<java.lang.Class<?>> declaringMatcher
protected transient boolean sealed
protected AbstractFuzzyMember()
protected AbstractFuzzyMember(AbstractFuzzyMember<T> other)
protected void prepareBuild()
Use this to prepare any special values.
public int getModifiersRequired()
Modifier
that is required for the member to match.public int getModifiersBanned()
Modifier
that must not be present for the member to match.public java.util.regex.Pattern getNameRegex()
public AbstractFuzzyMatcher<java.lang.Class<?>> getDeclaringMatcher()
public boolean isMatch(T value, java.lang.Object parent)
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMatcher<T extends java.lang.reflect.Member>
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 AbstractFuzzyMatcher<T extends java.lang.reflect.Member>
public java.lang.String toString()
toString
in class java.lang.Object
protected java.util.Map<java.lang.String,java.lang.Object> getKeyValueView()
Used by toString()
to print a representation of this object.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object