{
super(data, null);
_valueClass = valueClass;
StringBuilder errorMessageBuilder = new StringBuilder(10);
Name elementSchemaName = new Name(valueClass.getSimpleName());
_resultsSchema = new MapDataSchema(new RecordDataSchema(elementSchemaName, RecordDataSchema.RecordType.RECORD));
_resultsField = new RecordDataSchema.Field(_resultsSchema);
_resultsField.setName(RESULTS, errorMessageBuilder);
Name errorSchemaName = new Name(ErrorResponse.class.getSimpleName());
_errorsSchema = new MapDataSchema(new RecordDataSchema(errorSchemaName, RecordDataSchema.RecordType.RECORD));
_errorsField = new RecordDataSchema.Field(_errorsSchema);
_errorsField.setName(ERRORS, errorMessageBuilder);
if (data().get(RESULTS) == null)
{
data().put(RESULTS, new DataMap(resultsCapacity));
}
if (data().get(ERRORS) == null)
{
data().put(ERRORS, new DataMap(errorsCapacity));
}
_schema = new RecordDataSchema(_BATCH_RESPONSE_NAME, RecordDataSchema.RecordType.RECORD);
_schema.setFields(Arrays.asList(_resultsField, _errorsField), errorMessageBuilder);
}