aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-01-27 09:07:29 +0200
committerGitHub <noreply@github.com>2017-01-27 09:07:29 +0200
commita1cc08d7b98b09e45a01bde6abe13ffdcb200598 (patch)
tree002e876c08290f2a8e847169ab62f09e91efdefa /server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java
parentddbb619651a9073666274592359124ce271725ed (diff)
downloadvaadin-framework-a1cc08d7b98b09e45a01bde6abe13ffdcb200598.tar.gz
vaadin-framework-a1cc08d7b98b09e45a01bde6abe13ffdcb200598.zip
Implement GridSortOrder and SortOrderBuilders (#8338)
Diffstat (limited to 'server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java')
-rw-r--r--server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java b/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java
index b50b5c7fc8..13694010c7 100644
--- a/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java
+++ b/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java
@@ -17,6 +17,7 @@ package com.vaadin.data.provider;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
/**
* A data provider that lazy loads items from a back end.
@@ -45,6 +46,22 @@ public interface BackEndDataProvider<T, F> extends DataProvider<T, F> {
void setSortOrders(List<QuerySortOrder> sortOrders);
/**
+ * Sets the sort order to use, given a {@link QuerySortOrderBuilder}.
+ * Shorthand for {@code setSortOrders(builder.build())}.
+ *
+ * @see QuerySortOrderBuilder
+ *
+ * @param builder
+ * the sort builder to retrieve the sort order from
+ * @throws NullPointerException
+ * if builder is null
+ */
+ default void setSortOrders(QuerySortOrderBuilder builder) {
+ Objects.requireNonNull("Sort builder cannot be null.");
+ setSortOrders(builder.build());
+ }
+
+ /**
* Sets a single sort order to use as the default sorting for this data
* provider. This overrides the sorting set by any other method that
* manipulates the default sorting of this data provider.