public class FuzzyClassContract extends AbstractFuzzyMatcher<java.lang.Class<?>>
Modifier and Type | Class and Description |
---|---|
static class |
FuzzyClassContract.Builder
Represents a class contract builder.
|
Modifier and Type | Method and Description |
---|---|
protected int |
calculateRoundNumber()
Calculate the round number indicating when this matcher should be applied.
|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
getBaseclassContracts()
Retrieve an immutable list of every baseclass contract.
|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
getConstructorContracts()
Retrieve an immutable list of every constructor contract.
|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>> |
getFieldContracts()
Retrieve an immutable list of every field contract.
|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
getInterfaceContracts()
Retrieve an immutable list of every interface contract.
|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
getMethodContracts()
Retrieve an immutable list of every method contract.
|
boolean |
isMatch(java.lang.Class<?> value,
java.lang.Object parent)
Determine if the given value is a match.
|
static FuzzyClassContract.Builder |
newBuilder()
Construct a new fuzzy class contract builder.
|
java.lang.String |
toString() |
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
public static FuzzyClassContract.Builder newBuilder()
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>> getFieldContracts()
This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getMethodContracts()
This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getConstructorContracts()
This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> getBaseclassContracts()
This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> getInterfaceContracts()
This list is ordered in descending order of priority.
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<java.lang.Class<?>>
public boolean isMatch(java.lang.Class<?> value, java.lang.Object parent)
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMatcher<java.lang.Class<?>>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.public java.lang.String toString()
toString
in class java.lang.Object