com.cumulocity.sdk.client
Class PagedCollectionResourceImpl<T extends BaseCollectionRepresentation>

java.lang.Object
  extended by com.cumulocity.sdk.client.GenericResourceImpl<T>
      extended by com.cumulocity.sdk.client.PagedCollectionResourceImpl<T>
All Implemented Interfaces:
GenericResource<T>, PagedCollectionResource<T>
Direct Known Subclasses:
AlarmCollectionImpl, AuditRecordCollectionImpl, EventCollectionImpl, ExternalIDCollectionImpl, ManagedObjectCollectionImpl, ManagedObjectReferenceCollectionImpl, MeasurementCollectionImpl, OperationCollectionImpl

public abstract class PagedCollectionResourceImpl<T extends BaseCollectionRepresentation>
extends GenericResourceImpl<T>
implements PagedCollectionResource<T>


Field Summary
 
Fields inherited from class com.cumulocity.sdk.client.GenericResourceImpl
restConnector, url
 
Constructor Summary
PagedCollectionResourceImpl(RestConnector restConnector, String url)
          Deprecated. 
PagedCollectionResourceImpl(RestConnector restConnector, String url, int pageSize)
           
 
Method Summary
 boolean equals(Object obj)
           
 T get()
          The method returns the first page.
 T get(int pageSize)
          The method returns the first page.
 T getNextPage(BaseCollectionRepresentation collectionRepresentation)
          The method returns the next page from the collection.
 T getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber)
          The method returns the specified page number.
 T getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber, int pageSize)
          The method returns the specified page number.
 T getPreviousPage(BaseCollectionRepresentation collectionRepresentation)
          This method returns the previous page in the collection.
 int hashCode()
           
 
Methods inherited from class com.cumulocity.sdk.client.GenericResourceImpl
getMediaType, getResponseClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagedCollectionResourceImpl

@Deprecated
public PagedCollectionResourceImpl(RestConnector restConnector,
                                              String url)
Deprecated. 


PagedCollectionResourceImpl

public PagedCollectionResourceImpl(RestConnector restConnector,
                                   String url,
                                   int pageSize)
Method Detail

getPage

public T getPage(BaseCollectionRepresentation collectionRepresentation,
                 int pageNumber)
                                               throws SDKException
Description copied from interface: PagedCollectionResource
The method returns the specified page number.

Specified by:
getPage in interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Parameters:
collectionRepresentation - It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.
pageNumber - - page number
Returns:
BaseCollectionRepresentation type of BaseCollectionRepresentation.
Throws:
SDKException

getPage

public T 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 interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Parameters:
collectionRepresentation - It uses the BaseCollectionRepresentation.getSelf() URL to find the collection.
pageNumber - - page number
pageSize - - page size
Returns:
BaseCollectionRepresentation type of BaseCollectionRepresentation.
Throws:
SDKException

getNextPage

public T getNextPage(BaseCollectionRepresentation collectionRepresentation)
                                                   throws SDKException
Description copied from interface: PagedCollectionResource
The method returns the next page from the collection.

Specified by:
getNextPage in interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Parameters:
collectionRepresentation - It uses the BaseCollectionRepresentation.getNext() URL to find the collection.
Returns:
collectionRepresentation type of BaseCollectionRepresentation.
Throws:
SDKException

getPreviousPage

public T getPreviousPage(BaseCollectionRepresentation collectionRepresentation)
                                                       throws SDKException
Description copied from interface: PagedCollectionResource
This method returns the previous page in the collection.

Specified by:
getPreviousPage in interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Parameters:
collectionRepresentation - - It uses the BaseCollectionRepresentation.getPrevious() URL to find the collection.
Returns:
BaseCollectionRepresentation type of BaseCollectionRepresentation.
Throws:
SDKException

get

public T get()
                                           throws SDKException
Description copied from interface: PagedCollectionResource
The method returns the first page.

Specified by:
get in interface GenericResource<T extends BaseCollectionRepresentation>
Specified by:
get in interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Overrides:
get in class GenericResourceImpl<T extends BaseCollectionRepresentation>
Throws:
SDKException

get

public T get(int pageSize)
                                           throws SDKException
Description copied from interface: PagedCollectionResource
The method returns the first page.

Specified by:
get in interface PagedCollectionResource<T extends BaseCollectionRepresentation>
Parameters:
pageSize - - page size
Returns:
BaseCollectionRepresentation type of BaseCollectionRepresentation.
Throws:
SDKException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.