summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2016-11-25 16:53:26 +0200
committerVaadin Code Review <review@vaadin.com>2016-11-29 10:18:04 +0000
commit13443562ccbd633ceb561bb87893014f65437ad1 (patch)
tree234a320e68fd1dc374911c9eaeaf0581ce89c465 /uitest
parent907e24164fe6ce5389475c5b1a6b5b74992c3637 (diff)
downloadvaadin-framework-13443562ccbd633ceb561bb87893014f65437ad1.tar.gz
vaadin-framework-13443562ccbd633ceb561bb87893014f65437ad1.zip
Provide in-memory sorting information in Query
Change-Id: Iebafff6079816c08e5a4d144f6891d1379751f12
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java
index f050d1f454..5f02135591 100644
--- a/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java
+++ b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java
@@ -19,7 +19,8 @@ public class ItemDataProvider extends BackEndDataProvider<String, String> {
q -> size(q, size));
}
- private static Stream<String> itemStream(Query<String> q, int size) {
+ private static Stream<String> itemStream(Query<String, String> q,
+ int size) {
Stream<String> stream = IntStream.range(0, size)
.mapToObj(i -> "Item " + i);
String filterText = q.getFilter().orElse("").toLowerCase(Locale.US);
@@ -32,7 +33,7 @@ public class ItemDataProvider extends BackEndDataProvider<String, String> {
text -> text.toLowerCase(Locale.US).contains(filterText));
}
- private static int size(Query<String> q, int size) {
+ private static int size(Query<String, String> q, int size) {
if (!q.getFilter().orElse("").isEmpty()) {
return (int) itemStream(q, size).count();
}