public abstract class PagedCollectionResourceImpl<T,C extends BaseCollectionRepresentation<T>,I extends C> extends Object implements PagedCollectionResource<T,I>
Modifier and Type | Field and Description |
---|---|
protected int |
pageSize |
protected RestConnector |
restConnector |
PAGE_NUMBER_KEY, PAGE_SIZE_KEY
Constructor and Description |
---|
PagedCollectionResourceImpl(RestConnector restConnector,
String url,
int pageSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
I |
get(int pageSize,
QueryParam... queryParams)
The method returns the first page.
|
protected I |
get(Map<String,String> params) |
I |
get(QueryParam... queryParams)
The method returns the first page.
|
protected I |
getCollection(String url) |
protected abstract CumulocityMediaType |
getMediaType() |
I |
getNextPage(BaseCollectionRepresentation collectionRepresentation)
The method returns the next page from the collection.
|
I |
getPage(BaseCollectionRepresentation collectionRepresentation,
int pageNumber)
The method returns the specified page number.
|
I |
getPage(BaseCollectionRepresentation collectionRepresentation,
int pageNumber,
int pageSize)
The method returns the specified page number.
|
I |
getPreviousPage(BaseCollectionRepresentation collectionRepresentation)
This method returns the previous page in the collection.
|
protected abstract Class<C> |
getResponseClass() |
int |
hashCode() |
protected Map<String,String> |
prepareGetParams(int pageSize) |
protected abstract I |
wrap(C collection) |
protected int pageSize
protected final RestConnector restConnector
public PagedCollectionResourceImpl(RestConnector restConnector, String url, int pageSize)
protected abstract CumulocityMediaType getMediaType()
public I getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber) throws SDKException
PagedCollectionResource
getPage
in interface PagedCollectionResource<T,I extends C>
collectionRepresentation
- It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.pageNumber
- - page numberSDKException
- if the query failedpublic I getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber, int pageSize) throws SDKException
PagedCollectionResource
getPage
in interface PagedCollectionResource<T,I extends C>
collectionRepresentation
- It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.pageNumber
- - page numberpageSize
- - page sizeSDKException
- if the query failedprotected I getCollection(String url) throws SDKException
SDKException
public I getNextPage(BaseCollectionRepresentation collectionRepresentation) throws SDKException
PagedCollectionResource
getNextPage
in interface PagedCollectionResource<T,I extends C>
collectionRepresentation
- It uses the BaseCollectionRepresentation.getNext() URL to find the collection.SDKException
- if the query failedpublic I getPreviousPage(BaseCollectionRepresentation collectionRepresentation) throws SDKException
PagedCollectionResource
getPreviousPage
in interface PagedCollectionResource<T,I extends C>
collectionRepresentation
- - It uses the BaseCollectionRepresentation.getPrevious() URL to find the collection.SDKException
- if the query failedpublic I get(QueryParam... queryParams) throws SDKException
PagedCollectionResource
get
in interface PagedCollectionResource<T,I extends C>
queryParams
- query parametersSDKException
- if the query failedpublic I get(int pageSize, QueryParam... queryParams) throws SDKException
PagedCollectionResource
get
in interface PagedCollectionResource<T,I extends C>
pageSize
- - page sizequeryParams
- query parametersSDKException
- if the query failedprotected I get(Map<String,String> params) throws SDKException
SDKException
Copyright © 2020 (C) Cumulocity GmbH. All rights reserved.