- Object
-
- AbstractFallbackCondition
-
- TypedFallbackCondition
-
- SingleTypedFallbackCondition
-
- All Implemented Interfaces:
Comparable<FallbackCondition>
,FallbackCondition
public class SingleTypedFallbackCondition extends TypedFallbackCondition implements FallbackCondition, Comparable<FallbackCondition>
Represents aTypedFallbackCondition
that filters on a single type.If either
Convex
type matches this type, 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 SingleTypedFallbackCondition(Class<? extends Convex> type)
Minimal constructor.SingleTypedFallbackCondition(Class<? extends Convex> type, boolean strict)
Optional constructor.SingleTypedFallbackCondition(Class<? extends Convex> type, int sortIndex)
Optional constructor.SingleTypedFallbackCondition(Class<? extends Convex> type, int sortIndex, boolean strict)
Full constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Class<? extends Convex>
getType()
Returns the 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
isStrict()
Returns true if this condition uses a strict type comparison.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
-
SingleTypedFallbackCondition
public SingleTypedFallbackCondition(Class<? extends Convex> type)
Minimal constructor.- Parameters:
type
- the type
-
SingleTypedFallbackCondition
public SingleTypedFallbackCondition(Class<? extends Convex> type, int sortIndex)
Optional constructor.- Parameters:
type
- the typesortIndex
- the sort index of this condition
-
SingleTypedFallbackCondition
public SingleTypedFallbackCondition(Class<? extends Convex> type, boolean strict)
Optional constructor.- Parameters:
type
- the typestrict
- true if a strict type comparison should be performed
-
-
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
-
getType
public Class<? extends Convex> getType()
Returns the type for this fallback condition.- Returns:
- Class<? extends
Convex
>
-
isStrict
public boolean isStrict()
Returns true if this condition uses a strict type comparison.- Returns:
- boolean
-
-