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

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

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

A Batch of records. Used to return a fixed-size, unordered, complete collection of records, keyed on resource ID. Used as a response for a get_batch request.


Field Summary
static java.lang.String ERRORS
           
static java.lang.String RESULTS
           
 
Constructor Summary
BatchResponse(java.lang.Class<T> valueClass, int resultsCapacity, int errorsCapacity)
          Initialize a BatchResponse with the given valueClass and capacities.
BatchResponse(com.linkedin.data.DataMap data, java.lang.Class<T> valueClass)
          Initialize a BatchResponse with the given data and valueClass.
 
Method Summary
 java.util.Map<java.lang.String,ErrorResponse> getErrors()
           
 java.util.Map<java.lang.String,T> getResults()
           
 com.linkedin.data.schema.RecordDataSchema schema()
           
 
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

RESULTS

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

ERRORS

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

BatchResponse

public BatchResponse(com.linkedin.data.DataMap data,
                     java.lang.Class<T> valueClass)
Initialize a BatchResponse with the given data and valueClass.

Parameters:
data - the class that the BatchResponse contains (a RecordTemplate, a CreateStatus, etc.)
valueClass - the class that the BatchResponse contains

BatchResponse

public BatchResponse(java.lang.Class<T> valueClass,
                     int resultsCapacity,
                     int errorsCapacity)
Initialize a BatchResponse with the given valueClass and capacities.

Parameters:
valueClass - the class that the BatchResponse contains (a RecordTemplate, a CreateStatus, etc.)
resultsCapacity - initial capacity for results
errorsCapacity - initial capacity for errors
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

getResults

public java.util.Map<java.lang.String,T> getResults()
Returns:
a Map of String keys to RecordTemplate results

getErrors

public java.util.Map<java.lang.String,ErrorResponse> getErrors()
Returns:
a Map of String keys to ErrorResponses