Top Description Classes
[default module]

Package org.springframework.util.comparator

Annotations
@NonNullApi
@NonNullFields
Imports
org.springframework.lang.NonNullApi, .NonNullFields

Useful generic java.util.Comparator implementations, such as an invertible comparator and a compound comparator.

Class Summary

Modifier and TypeClass and Description
public class
BooleanComparator

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

public class
ComparableComparator<
the type of comparable objects that may be compared by this comparator
T extends Comparable<T>
>

Deprecated since 6.1. as of 6.1 in favor of Comparator#naturalOrder()
Comparator that adapts Comparables to the Comparator interface.
public abstract class
Comparators

Convenient entry point with generically typed factory methods for common Spring Comparator variants.

public class
InstanceComparator<
the type of objects that may be compared by this comparator
T
>

Compares objects based on an arbitrary class order.

public class
NullSafeComparator<
the type of objects that may be compared by this comparator
T
>

Deprecated since 6.1. as of 6.1 in favor of Comparator#nullsLast and Comparator#nullsFirst
A Comparator that will safely compare nulls to be lower or higher than other objects.