Class BooleanComparator
- java.lang.Object
- org.springframework.util.comparator.BooleanComparator
- All Implemented Interfaces:
Serializable
,Comparator<Boolean>
public class BooleanComparator extends Object implements Comparator<Boolean>, Serializable
- Since:
- 1.2.2
- Author:
- Keith Donald
- See Also:
- Serialized Form
Field Summary
Fields Modifier and Type Field Description static BooleanComparator
TRUE_HIGH
A shared default instance of this comparator, treatingtrue
higher thanfalse
.static BooleanComparator
TRUE_LOW
A shared default instance of this comparator, treatingtrue
lower thanfalse
.
Constructor Summary
Constructors Constructor Description BooleanComparator(boolean trueLow)
Create a BooleanComparator that sorts boolean values based on the provided flag.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Boolean v1, Boolean v2)
boolean
equals(Object other)
int
hashCode()
String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Field Detail
TRUE_LOW
public static final BooleanComparator TRUE_LOW
A shared default instance of this comparator, treatingtrue
lower thanfalse
.
TRUE_HIGH
public static final BooleanComparator TRUE_HIGH
A shared default instance of this comparator, treatingtrue
higher thanfalse
.
Constructor Detail
BooleanComparator
public 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_LOW
andBooleanComparator.TRUE_HIGH
.