public final class

BooleanComparator

extends Object
implements Serializable Comparator<T>
java.lang.Object
   ↳ org.springframework.util.comparator.BooleanComparator

Class Overview

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

Summary

Fields
public static final BooleanComparator TRUE_HIGH A shared default instance of this comparator, treating true higher than false.
public static final BooleanComparator TRUE_LOW A shared default instance of this comparator, treating true lower than false.
Public Constructors
BooleanComparator(boolean trueLow)
Create a BooleanComparator that sorts boolean values based on the provided flag.
Public Methods
int compare(Boolean v1, Boolean v2)
boolean equals(Object obj)
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Comparator

Fields

public static final BooleanComparator TRUE_HIGH

Also: SpringCore

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

public static final BooleanComparator TRUE_LOW

Also: SpringCore

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

Public Constructors

public BooleanComparator (boolean trueLow)

Also: SpringCore

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.

Parameters
trueLow whether to treat true as lower or higher than false

Public Methods

public int compare (Boolean v1, Boolean v2)

Also: SpringCore

public boolean equals (Object obj)

public int hashCode ()

public String toString ()