com.linkedin.restli.common
Class CollectionResponse<T extends com.linkedin.data.template.RecordTemplate>

java.lang.Object
  extended by com.linkedin.data.template.RecordTemplate
      extended by com.linkedin.restli.common.CollectionResponse<T>
All Implemented Interfaces:
com.linkedin.data.template.DataTemplate<com.linkedin.data.DataMap>, java.lang.Cloneable

public class CollectionResponse<T extends com.linkedin.data.template.RecordTemplate>
extends com.linkedin.data.template.RecordTemplate

A Collection of records. Used for returning an ordered, variable-length, navigable collection of resources.


Field Summary
static java.lang.String ELEMENTS
           
static java.lang.String METADATA
           
 
Constructor Summary
CollectionResponse(java.lang.Class<T> elementClass)
          Initialize a CollectionResponse based on the type of elements it returns.
CollectionResponse(com.linkedin.data.DataMap data, java.lang.Class<T> elementClass)
          Initialize a CollectionResponse based on the given dataMap and the elements it returns.
 
Method Summary
 java.util.List<T> getElements()
           
 com.linkedin.data.DataMap getMetadataRaw()
           
 CollectionMetadata getPaging()
           
 boolean hasPaging()
           
 void removePaging()
           
 com.linkedin.data.schema.RecordDataSchema schema()
           
 void setMetadataRaw(com.linkedin.data.DataMap metadata)
           
 void setPaging(CollectionMetadata value)
           
 
Methods inherited from class com.linkedin.data.template.RecordTemplate
clone, contains, copy, data, equals, hashCode, obtainDirect, obtainWrapped, putDirect, putDirect, putDirect, putWrapped, putWrapped, remove, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENTS

public static final java.lang.String ELEMENTS
See Also:
Constant Field Values

METADATA

public static final java.lang.String METADATA
See Also:
Constant Field Values
Constructor Detail

CollectionResponse

public CollectionResponse(java.lang.Class<T> elementClass)
Initialize a CollectionResponse based on the type of elements it returns.

Parameters:
elementClass - the class of the elements returned

CollectionResponse

public CollectionResponse(com.linkedin.data.DataMap data,
                          java.lang.Class<T> elementClass)
Initialize a CollectionResponse based on the given dataMap and the elements it returns.

Parameters:
data - a DataMap
elementClass - the class of the elements returned
Method Detail

schema

public com.linkedin.data.schema.RecordDataSchema schema()
Specified by:
schema in interface com.linkedin.data.template.DataTemplate<com.linkedin.data.DataMap>
Overrides:
schema in class com.linkedin.data.template.RecordTemplate

getElements

public java.util.List<T> getElements()

hasPaging

public boolean hasPaging()

removePaging

public void removePaging()

getPaging

public CollectionMetadata getPaging()

setPaging

public void setPaging(CollectionMetadata value)

setMetadataRaw

public void setMetadataRaw(com.linkedin.data.DataMap metadata)

getMetadataRaw

public com.linkedin.data.DataMap getMetadataRaw()