com.vaadin.flow.function.
Interface SerializableComparator<T>
-
Type Parameters:
T
- the type of objects that may be compared by this comparatorAll Superinterfaces:
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SerializableComparator<T> extends Comparator<T>, Serializable
A
Comparator
that is alsoSerializable
.You can create a serializable comparator from a regular comparator through a method reference by appending
::compare
. For exampleSerializableComparator<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 inComparator
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
-
-