com.vaadin.flow.function.
Interface SerializableComparator<T>
Type Parameters:
T
- the type of objects that may be compared by this comparator
All Superinterfaces:
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A Comparator
that is also Serializable
.
You can create a serializable comparator from a regular comparator through a
method reference by appending ::compare
. For example
SerializableComparator<Employee>
comparator = Comparator.comparing(Employee::getFirstName)::compare
.
The resulting comparator will in most cases cause exceptions if it is
actually being serialized, but this construct will enable using the
shorthands in Comparator
in applications where session will not be
serialized.
Since:
1.0
Author:
Vaadin Ltd
-
Method Summary
Methods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong