- Object
-
- AbstractFallbackCondition
-
- TypedFallbackCondition
-
- PairwiseTypedFallbackCondition
-
- All Implemented Interfaces:
Comparable<FallbackCondition>
,FallbackCondition
public class PairwiseTypedFallbackCondition extends TypedFallbackCondition implements FallbackCondition, Comparable<FallbackCondition>
Represents aTypedFallbackCondition
that filters on a particular pair of types.If the pair of
Convex
types match this pair, then the condition is met.Note: this class has a natural ordering that is inconsistent with equals.
- Since:
- 3.1.5
- Version:
- 3.2.0
- Author:
- William Bittle
-
-
Constructor Summary
Constructors Constructor Description PairwiseTypedFallbackCondition(Class<? extends Convex> type1, boolean strict1, Class<? extends Convex> type2, boolean strict2)
Optional constructor.PairwiseTypedFallbackCondition(Class<? extends Convex> type1, boolean strict1, Class<? extends Convex> type2, boolean strict2, int sortIndex)
Full constructor.PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2)
Minimal constructor.PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, boolean strict)
Optional constructor.PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, boolean strict, int sortIndex)
Optional constructor.PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, int sortIndex)
Optional constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Class<? extends Convex>
getType1()
Returns the first type for this fallback condition.Class<? extends Convex>
getType2()
Returns the second type for this fallback condition.int
hashCode()
boolean
isMatch(Class<? extends Convex> type1, Class<? extends Convex> type2)
Returns true if the given types match this condition.boolean
isStrict1()
Returns true if this condition uses a strict type comparison for the first type.boolean
isStrict2()
Returns true if this condition uses a strict type comparison for the second type.String
toString()
-
Methods inherited from class TypedFallbackCondition
isMatch
-
Methods inherited from class AbstractFallbackCondition
compareTo, getSortIndex
-
Methods inherited from interface Comparable
compareTo
-
Methods inherited from interface FallbackCondition
getSortIndex, isMatch
-
-
-
-
Constructor Detail
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2)
Minimal constructor.The ordering of the types doesn't matter.
The type matching defaults to strict for both types.
- Parameters:
type1
- the first type of the pairtype2
- the second type of the pair
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, int sortIndex)
Optional constructor.The ordering of the types doesn't matter.
The type matching defaults to strict for both types.
- Parameters:
type1
- the first type of the pairtype2
- the second type of the pairsortIndex
- the sort index of this condition
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, boolean strict)
Optional constructor.The ordering of the types doesn't matter.
- Parameters:
type1
- the first type of the pairtype2
- the second type of the pairstrict
- true if a strict type comparison should be performed for both types
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, Class<? extends Convex> type2, boolean strict, int sortIndex)
Optional constructor.The ordering of the types doesn't matter.
- Parameters:
type1
- the first type of the pairtype2
- the second type of the pairstrict
- true if a strict type comparison should be performed on both typessortIndex
- the sort index of this condition
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, boolean strict1, Class<? extends Convex> type2, boolean strict2)
Optional constructor.The ordering of the types doesn't matter.
- Parameters:
type1
- the first type of the pairstrict1
- true if a strict type comparison should be performed on the first typetype2
- the second type of the pairstrict2
- true if a strict type comparison should be performed on the second type
-
PairwiseTypedFallbackCondition
public PairwiseTypedFallbackCondition(Class<? extends Convex> type1, boolean strict1, Class<? extends Convex> type2, boolean strict2, int sortIndex)
Full constructor.The ordering of the types doesn't matter.
- Parameters:
type1
- the first type of the pairstrict1
- true if a strict type comparison should be performed on the first typetype2
- the second type of the pairstrict2
- true if a strict type comparison should be performed on the second typesortIndex
- the sort index of this condition
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractFallbackCondition
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractFallbackCondition
-
isMatch
public boolean isMatch(Class<? extends Convex> type1, Class<? extends Convex> type2)
Description copied from class:TypedFallbackCondition
Returns true if the given types match this condition.- Specified by:
isMatch
in classTypedFallbackCondition
- Parameters:
type1
- the type of the firstConvex
type2
- the type of the secondConvex
- Returns:
- boolean
-
getType1
public Class<? extends Convex> getType1()
Returns the first type for this fallback condition.- Returns:
- Class<? extends
Convex
>
-
getType2
public Class<? extends Convex> getType2()
Returns the second type for this fallback condition.- Returns:
- Class<? extends
Convex
>
-
isStrict1
public boolean isStrict1()
Returns true if this condition uses a strict type comparison for the first type.- Returns:
- boolean
-
isStrict2
public boolean isStrict2()
Returns true if this condition uses a strict type comparison for the second type.- Returns:
- boolean
-
-