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
Fields inherited from interface com.cumulocity.sdk.client.PagedCollectionResource
PAGE_NUMBER_KEY, PAGE_SIZE_KEY
-
Constructor Summary
ConstructorDescriptionPagedCollectionResourceImpl
(RestConnector restConnector, String url, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(int pageSize, QueryParam... queryParams) The method returns the first page.get
(QueryParam... queryParams) The method returns the first page.protected I
protected I
getCollection
(String url) protected abstract CumulocityMediaType
getNextPage
(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.int
hashCode()
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:PagedCollectionResource
The method returns the specified page number.- Specified by:
getPage
in 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:PagedCollectionResource
The method returns the specified page number.- Specified by:
getPage
in 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:PagedCollectionResource
The method returns the next page from the collection.- Specified by:
getNextPage
in 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:PagedCollectionResource
This method returns the previous page in the collection.- Specified by:
getPreviousPage
in 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:PagedCollectionResource
The method returns the first page.- Specified by:
get
in 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:PagedCollectionResource
The method returns the first page.- Specified by:
get
in 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()
-