/** * Return the next page of result for the query using a new continuationToken. * * @param continuationToken the {@code String} with the previous continuationToken. It cannot be {@code null} or empty. * @return A {@link QueryResult} with the next page of items for the query. * @throws NoSuchElementException if the query does no have more pages to return. */ public QueryResult next(String continuationToken) { /* SRS_QUERY_21_018: [The next shall throw NoSuchElementException if the provided continuationToken is null or empty.] */ if(Tools.isNullOrEmpty(continuationToken)) { throw new NoSuchElementException("There is no Continuation Token to get pending elements,"); } /* SRS_QUERY_21_019: [The next shall store the provided continuationToken.] */ this.continuationToken = continuationToken; /* SRS_QUERY_21_020: [The next shall return the next page of results by calling the next().] */ return next(); }
QueryResult queryResult = query.next(); System.out.println(queryResult);
QueryResult queryResult = query.next(); System.out.println(queryResult);
QueryResult queryResult = query.next(); System.out.println(queryResult);