Package com.cumulocity.sdk.client
Class PagedCollectionResourceImpl<T,C extends BaseCollectionRepresentation<T>,I extends C>
java.lang.Object
com.cumulocity.sdk.client.PagedCollectionResourceImpl<T,C,I>
- All Implemented Interfaces:
PagedCollectionResource<T,I>
- Direct Known Subclasses:
AlarmCollectionImpl,AuditRecordCollectionImpl,EventCollectionImpl,ExternalIDCollectionImpl,ManagedObjectCollectionImpl,ManagedObjectReferenceCollectionImpl,MeasurementCollectionImpl,NotificationSubscriptionCollectionImpl,OperationCollectionImpl,TenantOptionCollectionImpl
public abstract class PagedCollectionResourceImpl<T,C extends BaseCollectionRepresentation<T>,I extends C>
extends Object
implements PagedCollectionResource<T,I>
-
Field Summary
FieldsFields inherited from interface com.cumulocity.sdk.client.PagedCollectionResource
PAGE_NUMBER_KEY, PAGE_SIZE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionPagedCollectionResourceImpl(RestConnector restConnector, String url, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionbooleanget(int pageSize, QueryParam... queryParams) The method returns the first page.get(QueryParam... queryParams) The method returns the first page.protected Iprotected IgetCollection(String url) protected abstract CumulocityMediaTypegetNextPage(BaseCollectionRepresentation collectionRepresentation) The method returns the next page from the collection.getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber) The method returns the specified page number.getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber, int pageSize) The method returns the specified page number.getPreviousPage(BaseCollectionRepresentation collectionRepresentation) This method returns the previous page in the collection.inthashCode()prepareGetParams(int pageSize) protected abstract I
-
Field Details
-
pageSize
protected int pageSize -
restConnector
-
-
Constructor Details
-
PagedCollectionResourceImpl
-
-
Method Details
-
getMediaType
-
getResponseClass
-
getPage
public I getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber) throws SDKException Description copied from interface:PagedCollectionResourceThe method returns the specified page number.- Specified by:
getPagein interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
collectionRepresentation- It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.pageNumber- - page number- Returns:
- BaseCollectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
getPage
public I getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber, int pageSize) throws SDKException Description copied from interface:PagedCollectionResourceThe method returns the specified page number.- Specified by:
getPagein interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
collectionRepresentation- It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.pageNumber- - page numberpageSize- - page size- Returns:
- BaseCollectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
getCollection
- Throws:
SDKException
-
wrap
-
getNextPage
Description copied from interface:PagedCollectionResourceThe method returns the next page from the collection.- Specified by:
getNextPagein interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
collectionRepresentation- It uses the BaseCollectionRepresentation.getNext() URL to find the collection.- Returns:
- collectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
getPreviousPage
Description copied from interface:PagedCollectionResourceThis method returns the previous page in the collection.- Specified by:
getPreviousPagein interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
collectionRepresentation- - It uses the BaseCollectionRepresentation.getPrevious() URL to find the collection.- Returns:
- BaseCollectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
get
Description copied from interface:PagedCollectionResourceThe method returns the first page.- Specified by:
getin interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
queryParams- query parameters- Returns:
- BaseCollectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
get
Description copied from interface:PagedCollectionResourceThe method returns the first page.- Specified by:
getin interfacePagedCollectionResource<T,C extends BaseCollectionRepresentation<T>> - Parameters:
pageSize- - page sizequeryParams- query parameters- Returns:
- BaseCollectionRepresentation type of BaseCollectionRepresentation.
- Throws:
SDKException- if the query failed
-
get
- Throws:
SDKException
-
prepareGetParams
-
equals
-
hashCode
public int hashCode()
-