org.apache.shindig.protocol
Class RestfulCollection<T>

java.lang.Object
  extended by org.apache.shindig.protocol.RestfulCollection<T>

public class RestfulCollection<T>
extends Object

Data structure representing a Rest response.


Constructor Summary
RestfulCollection(List<T> entry)
          Creates a new RestfulCollection that includes a complete set of entries.
RestfulCollection(List<T> entry, int startIndex, int totalResults)
          Helper constructor for un-paged collection, Use RestfulCollection(java.util.List, int, int, int) in paginated context
RestfulCollection(List<T> entry, int startIndex, int totalResults, int itemsPerPage)
          Create a paginated collection response.
 
Method Summary
 List<T> getEntry()
           
 int getItemsPerPage()
           
 int getStartIndex()
           
 int getTotalResults()
           
 boolean isFiltered()
           
 boolean isSorted()
           
 boolean isUpdatedSince()
           
 void setEntry(List<T> entry)
           
 void setFiltered(boolean filtered)
           
 void setItemsPerPage(int itemsPerPage)
           
 void setSorted(boolean sorted)
           
 void setStartIndex(int startIndex)
           
 void setTotalResults(int totalResults)
           
 void setUpdatedSince(boolean updatedSince)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestfulCollection

public RestfulCollection(List<T> entry)
Creates a new RestfulCollection that includes a complete set of entries. Default values for startIndex, totalResults, itemsPerPage and filtering parameters are automatically set.

Parameters:
entry - a list of entries

RestfulCollection

public RestfulCollection(List<T> entry,
                         int startIndex,
                         int totalResults,
                         int itemsPerPage)
Create a paginated collection response.

Parameters:
entry - paginated entries
startIndex - the index corresponding to the first element of {entry}
totalResults - the total size of the resultset
itemsPerPage - the size of the pagination, generally set to the user-specified count parameter. Clamped to the totalResults size automatically
Since:
1.1-BETA4

RestfulCollection

public RestfulCollection(List<T> entry,
                         int startIndex,
                         int totalResults)
Helper constructor for un-paged collection, Use RestfulCollection(java.util.List, int, int, int) in paginated context

Method Detail

getEntry

public List<T> getEntry()

setEntry

public void setEntry(List<T> entry)

getStartIndex

public int getStartIndex()

setStartIndex

public void setStartIndex(int startIndex)

getTotalResults

public int getTotalResults()

setItemsPerPage

public void setItemsPerPage(int itemsPerPage)

getItemsPerPage

public int getItemsPerPage()

setTotalResults

public void setTotalResults(int totalResults)

isFiltered

public boolean isFiltered()

setFiltered

public void setFiltered(boolean filtered)

isSorted

public boolean isSorted()

setSorted

public void setSorted(boolean sorted)

isUpdatedSince

public boolean isUpdatedSince()

setUpdatedSince

public void setUpdatedSince(boolean updatedSince)


Copyright © 2007-2012. All Rights Reserved.