# Package org.springframework.util.comparator

@NonNullApi @NonNullFields package org.springframework.util.comparator
Useful generic `java.util.Comparator` implementations, such as an invertible comparator and a compound comparator.

Related Packages
Package
Description
org.springframework.util
Miscellaneous utility classes, such as utilities for working with strings, classes, collections, reflection, etc.
org.springframework.util.backoff
A generic back-off abstraction.
org.springframework.util.concurrent
Useful generic `java.util.concurrent.Future` extensions.
org.springframework.util.function
Useful generic `java.util.function` helper classes.
org.springframework.util.unit
Useful unit data types.
org.springframework.util.xml
Miscellaneous utility classes for XML parsing and transformation, such as error handlers that log warnings via Commons Logging.
Classes
Class
Description
BooleanComparator
A `Comparator` for `Boolean` objects that can sort either `true` or `false` first.
ComparableComparator<T extends Comparable<T>>
Deprecated.
as of 6.1 in favor of `Comparator.naturalOrder()`
Comparators
Convenient entry point with generically typed factory methods for common Spring `Comparator` variants.
InstanceComparator<T>
Compares objects based on an arbitrary class order.
NullSafeComparator<T>
Deprecated.
as of 6.1 in favor of `Comparator.nullsLast(java.util.Comparator<? super T>)` and `Comparator.nullsFirst(java.util.Comparator<? super T>)`