 |
- java.lang.Object
-
- org.springframework.util.comparator.BooleanComparator
-
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator<java.lang.Boolean>
public class BooleanComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Boolean>, java.io.Serializable
A Comparator for Boolean objects that can sort either
true or false first.
- Since:
- 1.2.2
- Author:
- Keith Donald
- See Also:
- Serialized Form
-
-
Field Summary
Fields
Modifier and Type |
Field and Description |
static BooleanComparator |
TRUE_HIGH
A shared default instance of this comparator,
treating true higher than false .
|
static BooleanComparator |
TRUE_LOW
A shared default instance of this comparator,
treating true lower than false .
|
-
Constructor Summary
Constructors
Constructor and Description |
BooleanComparator(boolean trueLow)
Create a BooleanComparator that sorts boolean values based on
the provided flag.
|
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
Field Detail
-
TRUE_LOW
public static final BooleanComparator TRUE_LOW
A shared default instance of this comparator,
treating true lower than false .
-
TRUE_HIGH
public static final BooleanComparator TRUE_HIGH
A shared default instance of this comparator,
treating true higher than false .
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
|
|