the first parameter, is the “current” page on which you are operating. A normal workflow would be to call one of get() methods which returns a BaseCollectionRepresentation of the first page and then navigate back and forwards using getNextPage() or getPreviousPage() while using the last fetched page for the first parameter. Or use getPage() to fetch a specific page. In any case you need to invoke get() once to get the first page.
Hi,
don’t forget the allPages() method (of PagedManagedObjectCollectionRepresentation) which returns a handy iterable, which will do the paging under the hood.
Hence you could do the following and don’t need to care about getting the next page. Once it reaches object 101 (in this case with page size 100) it will get the next page for you.
Iterable<ManagedObjectRepresentation> it = inventoryApi.getManagedObjectsByFilter(new InventoryFilter().byFragmentType(fragmentType)).get(100).allPages();
for(ManagedObjectRepresentation mo : it){
//do something
}