@Test public void getNextTokenReturnsATokenWhenTheSizePlusTheCurrentFromAreLessThanTheTotal() { final ObjectNode queryNode = jsnO("from", jsn(0), "size", jsn(10)); final ObjectNode resultNode = jsnO("hits", jsnO("total", jsn(20))); final EsFilterResult instance = new EsFilterResult(queryNode, resultNode); final String nextToken = instance.getNextToken(); assertThat(nextToken, is(notNullValue())); }
@Override public String getNextToken() { final int currentFrom = queryNode.has("from") ? queryNode.get("from").asInt() : 0; final int size = queryNode.get("size").asInt(); final int nextFrom = currentFrom + size; if (getTotal() > nextFrom) { return "" + nextFrom; } return null; }
EsFilterResult implements FilterResult { @Override public String getNextToken() { final int currentFrom = queryNode.has("from") ? queryNode.get("from").asInt() : 0; final int size = queryNode.get("size").asInt(); final int nextFrom = currentFrom + size; if (getTotal() > nextFrom) { return "" + nextFrom; } return null; } }
EsFilterResult implements FilterResult { @Override public String getNextToken() { final int currentFrom = queryNode.has("from") ? queryNode.get("from").asInt() : 0; final int size = queryNode.get("size").asInt(); final int nextFrom = currentFrom + size; if (getTotal() > nextFrom) { return "" + nextFrom; } return null; } EsFilterResult(JsonNode queryNode, JsonNode resultNode);  EsFilterResult(JsonNode queryNode, JsonNode resultNode, String idField); }
EsFilterResult implements FilterResult { @Override public String getNextToken() { final int currentFrom = queryNode.has("from") ? queryNode.get("from").asInt() : 0; final int size = queryNode.get("size").asInt(); final int nextFrom = currentFrom + size; if (getTotal() > nextFrom) { return "" + nextFrom; } return null; } EsFilterResult(JsonNode queryNode, JsonNode resultNode);  EsFilterResult(JsonNode queryNode, JsonNode resultNode, String idField); @Override List<String> getUriList(); @Override String getNextToken(); @Override String getPrevToken(); @Override int getTotal(); void findFacets(Facet facet, ObjectNode data); @Override List<Facet> getFacets(); }
EsFilterResult implements FilterResult { @Override public String getNextToken() { final int currentFrom = queryNode.has("from") ? queryNode.get("from").asInt() : 0; final int size = queryNode.get("size").asInt(); final int nextFrom = currentFrom + size; if (getTotal() > nextFrom) { return "" + nextFrom; } return null; } EsFilterResult(JsonNode queryNode, JsonNode resultNode);  EsFilterResult(JsonNode queryNode, JsonNode resultNode, String idField); @Override List<String> getUriList(); @Override String getNextToken(); @Override String getPrevToken(); @Override int getTotal(); void findFacets(Facet facet, ObjectNode data); @Override List<Facet> getFacets(); final String idField; }