diff options
Diffstat (limited to 'src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java')
-rw-r--r-- | src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java b/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java index 38d417d..b7c6750 100644 --- a/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java +++ b/src/main/java/io/trygvis/esper/testing/util/sql/PageRequest.java @@ -1,28 +1,20 @@ package io.trygvis.esper.testing.util.sql; import fj.data.*; -import static fj.data.Option.fromNull; -import io.trygvis.esper.testing.*; - -import javax.servlet.http.*; public class PageRequest { public final Option<Integer> startIndex; public final Option<Integer> count; - public static final PageRequest FIRST_PAGE = new PageRequest(Option.<Integer>none(), Option.<Integer>none()); + public final List<String> orderBy; + public static final PageRequest FIRST_PAGE = new PageRequest(Option.<Integer>none(), Option.<Integer>none(), List.<String>nil()); - public PageRequest(Option<Integer> startIndex, Option<Integer> count) { + public PageRequest(Option<Integer> startIndex, Option<Integer> count, List<String> orderBy) { this.startIndex = startIndex; this.count = count; + this.orderBy = orderBy; } public String toString() { return "PageRequest{startIndex=" + startIndex + ", count=" + count + '}'; } - - public static PageRequest pageReq(HttpServletRequest req) { - return new PageRequest( - fromNull(req.getParameter("startIndex")).bind(Util.parseInt), - fromNull(req.getParameter("count")).bind(Util.parseInt)); - } } |