Class FuzzyClassContract
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher<Class<?>>
com.comphenix.protocol.reflect.fuzzy.FuzzyClassContract
- All Implemented Interfaces:
Comparable<AbstractFuzzyMatcher<Class<?>>>
Determine if a given class implements a given fuzzy (duck typed) contract.
- Author:
- Kristian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a class contract builder. -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculate the round number indicating when this matcher should be applied.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<Class<?>>>Retrieve an immutable list of every baseclass contract.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>Retrieve an immutable list of every constructor contract.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<Field>>Retrieve an immutable list of every field contract.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<Class<?>>>Retrieve an immutable list of every interface contract.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>Retrieve an immutable list of every method contract.booleanDetermine if the given value is a match.static FuzzyClassContract.BuilderConstruct a new fuzzy class contract builder.toString()Methods inherited from class com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMatcher
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
-
Method Details
-
newBuilder
Construct a new fuzzy class contract builder.- Returns:
- A new builder.
-
getFieldContracts
Retrieve an immutable list of every field contract.This list is ordered in descending order of priority.
- Returns:
- List of every field contract.
-
getMethodContracts
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getMethodContracts()Retrieve an immutable list of every method contract.This list is ordered in descending order of priority.
- Returns:
- List of every method contract.
-
getConstructorContracts
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getConstructorContracts()Retrieve an immutable list of every constructor contract.This list is ordered in descending order of priority.
- Returns:
- List of every constructor contract.
-
getBaseclassContracts
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<Class<?>>> getBaseclassContracts()Retrieve an immutable list of every baseclass contract.This list is ordered in descending order of priority.
- Returns:
- List of every baseclass contract.
-
getInterfaceContracts
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<Class<?>>> getInterfaceContracts()Retrieve an immutable list of every interface contract.This list is ordered in descending order of priority.
- Returns:
- List of every interface contract.
-
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<Class<?>>- Returns:
- A number (positive or negative) that is used to order matchers.
-
isMatch
Description copied from class:AbstractFuzzyMatcherDetermine if the given value is a match.- Specified by:
isMatchin classAbstractFuzzyMatcher<Class<?>>- 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.
-
toString
-