DataProvider
and Query.getSortOrders()
.
For in-memory case, you can use also ListDataProvider.setSortComparator(SerializableComparator)
.
For back-end DataProviders, see AbstractBackEndDataProvider.setSortOrders(List)
.@Deprecated public interface ItemSorter extends Comparator<Object>, Cloneable, Serializable
Container.Sortable
interface.
The ItemSorter
interface can be used in Sortable
implementations to provide a custom sorting method.Modifier and Type | Method and Description |
---|---|
int |
compare(Object itemId1,
Object itemId2)
Deprecated.
Compares its two arguments for order.
|
void |
setSortProperties(Container.Sortable container,
Object[] propertyId,
boolean[] ascending)
Deprecated.
Sets the parameters for an upcoming sort operation.
|
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
void setSortProperties(Container.Sortable container, Object[] propertyId, boolean[] ascending)
ItemSorter
sorts the container.container
- The container that will be sorted. The container must contain
the propertyIds given in the propertyId
parameter.propertyId
- The property ids used for sorting. The property ids must exist
in the container and should only be used if they are also
sortable, i.e include in the collection returned by
container.getSortableContainerPropertyIds()
. See
Container.Sortable.sort(Object[], boolean[])
for more
information.ascending
- Sorting order flags for each property id. See
Container.Sortable.sort(Object[], boolean[])
for more
information.int compare(Object itemId1, Object itemId2)
The parameters for the ItemSorter
compare()
method must always be item ids which exist in the container set using
#setSortProperties(Sortable, Object[], boolean[])
.
compare
in interface Comparator<Object>
Comparator.compare(Object, Object)
Copyright © 2020 Vaadin Ltd. All rights reserved.