public class AssetPageIterator extends Object implements PageIterator<AssetListResource>
DEFAULT_PAGE_NUMBER, DEFAULT_PAGE_SIZE
Modifier and Type | Method and Description |
---|---|
static AssetPageIterator |
getInstance(AssetsClient assetsClient)
Returns an AssetPageIterator instance initialized with the assetsClient
|
static AssetPageIterator |
getInstance(AssetsClient assetsClient,
Integer pageSize)
Returns an AssetPageIterator instance initialized with the assetsClient
|
static AssetPageIterator |
getInstance(AssetsClient assetClient,
Integer pageSize,
Integer pageNumber)
Returns an AssetPageIterator instance initialized with the assetsClient
|
AssetListResource |
getPage(int pageNumber)
Returns the AssetListResource at a requested page number
|
AssetListResource |
next()
Returns the next page of Assets
|
AssetListResource |
previous()
Returns the previous page of Assets
|
public static AssetPageIterator getInstance(AssetsClient assetsClient) throws MindsphereClientException
assetsClient
- assetsClient that will be used to make API calls to fetch the assetsMindsphereClientException
- thrown if an error occurs while creating an instancepublic static AssetPageIterator getInstance(AssetsClient assetsClient, Integer pageSize) throws MindsphereClientException
assetsClient
- assetsClient that will be used to make API calls to fetch the assetspageSize
- number of records that should be available in each page. Default is 2000MindsphereClientException
- thrown if an error occurs while creating an instance with invalid page sizepublic static AssetPageIterator getInstance(AssetsClient assetClient, Integer pageSize, Integer pageNumber) throws MindsphereClientException
assetClient
- assetsClient that will be used to make API calls to fetch the assetspageSize
- number of records that should be available in each page. Default is 2000pageNumber
- Page number to be fetched. Default is -1MindsphereClientException
- thrown if an error occurs while creating an instance with invalid page sizepublic AssetListResource next() throws MindsphereException
next
in interface PageIterator<AssetListResource>
MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetListResource previous() throws MindsphereException
previous
in interface PageIterator<AssetListResource>
MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetListResource getPage(int pageNumber) throws MindsphereException
getPage
in interface PageIterator<AssetListResource>
MindsphereException
- thrown if an error occurs while attempting to invoke the API