Package eu.c6.gibraltar.api.common
Class ScrollResult
java.lang.Object
eu.c6.gibraltar.api.common.ScrollResult
The Class ScrollResult to manage scrollable result with an index.
Example :
IAnySession anySession = AnySession.getInstance("http://localhost:8080/any", "user01", "password01");
anySession.setApplication("demo");
ScrollResult result = anySession.getRoomsManager().getContents("demo_room__room0001", 0, Arrays.asList("core.name"));
List<ICObject> allResults = new ArrayList<>(result.getResults());
while (!result.isEmpty()) {
result = anySession.getRoomsManager().getContents("demo_room__room0001", result.getNextIndex(), Arrays.asList("core.name"));
allResults.addAll(result.getResults());
}
allResults.forEach(r -> System.out.println(r.getString("core.name")));
System.out.println("Total found : " + allResults.size());
-
Constructor Summary
ConstructorsConstructorDescriptionScrollResult(int fromIndex, int totalCount, List<ICObject> results) Instantiates a new scroll result. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ScrollResult
Instantiates a new scroll result.- Parameters:
fromIndex- the from index (starts at 0)totalCount- the total countresults- the results
-
-
Method Details
-
getFromIndex
public int getFromIndex()Gets the from index (starts at 0).- Returns:
- the from index
-
getResults
Gets the results.- Returns:
- the results
-
getTotalCount
public int getTotalCount()Gets the total count.- Returns:
- the total count
-
isEmpty
public boolean isEmpty()Checks if result list is empty.- Returns:
- true, if result list is empty
-
getNextIndex
public int getNextIndex()Gets the next index.- Returns:
- the next index
-
iterator
-