Class BooleanComparator
java.lang.Object
org.springframework.util.comparator.BooleanComparator
- All Implemented Interfaces:
- Serializable, Comparator<Boolean>
- Since:
- 1.2.2
- Author:
- Keith Donald, Eugene Rabii
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final BooleanComparatorA shared default instance of this comparator, treatingtruehigher thanfalse.static final BooleanComparatorA shared default instance of this comparator, treatingtruelower thanfalse.
- 
Constructor SummaryConstructorsConstructorDescriptionBooleanComparator(boolean trueLow) Create a BooleanComparator that sorts boolean values based on the provided flag.
- 
Method SummaryMethods inherited from interface Comparatorreversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Field Details- 
TRUE_LOWA shared default instance of this comparator, treatingtruelower thanfalse.
- 
TRUE_HIGHA shared default instance of this comparator, treatingtruehigher thanfalse.
 
- 
- 
Constructor Details- 
BooleanComparatorpublic BooleanComparator(boolean trueLow) Create a BooleanComparator that sorts boolean values based on the provided flag.Alternatively, you can use the default shared instances: BooleanComparator.TRUE_LOWandBooleanComparator.TRUE_HIGH.- Parameters:
- trueLow- whether to treat true as lower or higher than false
- See Also:
 
 
- 
- 
Method Details- 
compare- Specified by:
- comparein interface- Comparator<Boolean>
 
- 
equals
- 
hashCode
- 
toString
 
-