spring-framework / org.springframework.util.comparator / BooleanComparator

BooleanComparator

open class BooleanComparator : Comparator<Boolean>, Serializable

A Comparator for Boolean objects that can sort either true or false first.

Author
Keith Donald

Since
1.2.2

Constructors

<init>

BooleanComparator(trueLow: Boolean)

Create a BooleanComparator that sorts boolean values based on the provided flag.

Alternatively, you can use the default shared instances: BooleanComparator.TRUE_LOW and BooleanComparator.TRUE_HIGH.

Properties

TRUE_HIGH

static val TRUE_HIGH: BooleanComparator

A shared default instance of this comparator, treating true higher than false.

TRUE_LOW

static val TRUE_LOW: BooleanComparator

A shared default instance of this comparator, treating true lower than false.

Functions

compare

open fun compare(v1: Boolean, v2: Boolean): Int

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String