use of com.linkedin.data.DataList in project rest.li by linkedin.
the class BatchCollectionResponse method createCollectionFromDecoder.
private List<BatchFinderCriteriaResult<T>> createCollectionFromDecoder(BatchFinderCriteriaResultDecoder<T> decoder) {
DataList elements = this.data().getDataList(CollectionResponse.ELEMENTS);
List<BatchFinderCriteriaResult<T>> collection = elements.stream().map(obj -> decoder.makeValue((DataMap) obj)).collect(Collectors.toList());
return collection;
}
use of com.linkedin.data.DataList in project rest.li by linkedin.
the class BatchCreateIdEntityResponse method generateDataMap.
private static DataMap generateDataMap(List<? extends RecordTemplate> elements) {
DataMap dataMap = new DataMap();
DataList listElements = new DataList();
for (RecordTemplate recordTemplate : elements) {
CreateIdEntityStatus<?, ?> status = (CreateIdEntityStatus) recordTemplate;
CheckedUtil.addWithoutChecking(listElements, status.data());
}
dataMap.put(CollectionResponse.ELEMENTS, listElements);
return dataMap;
}
use of com.linkedin.data.DataList in project rest.li by linkedin.
the class BatchCreateIdEntityResponse method createCollectionFromDecoder.
private List<CreateIdEntityStatus<K, V>> createCollectionFromDecoder(CreateIdEntityStatusDecoder<K, V> decoder) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
DataList elements = this.data().getDataList(CollectionResponse.ELEMENTS);
List<CreateIdEntityStatus<K, V>> collection = new ArrayList<>(elements.size());
for (Object obj : elements) {
DataMap dataMap = (DataMap) obj;
CreateIdEntityStatus<K, V> status = decodeValue(dataMap, decoder);
collection.add(status);
}
return collection;
}
use of com.linkedin.data.DataList in project rest.li by linkedin.
the class BatchCreateResponse method generateDataMap.
private static DataMap generateDataMap(List<? extends RecordTemplate> elements) {
DataMap dataMap = new DataMap();
DataList listElements = new DataList();
for (RecordTemplate recordTemplate : elements) {
listElements.add(recordTemplate.data());
}
dataMap.put(CollectionResponse.ELEMENTS, listElements);
return dataMap;
}
use of com.linkedin.data.DataList in project rest.li by linkedin.
the class BatchCreateResponse method createCollectionFromDecoder.
private List<CreateStatus> createCollectionFromDecoder(CreateIdStatusDecoder<K> entityDecoder) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
DataList elements = this.data().getDataList(CollectionResponse.ELEMENTS);
List<CreateStatus> collection = new ArrayList<>(elements.size());
for (Object obj : elements) {
DataMap dataMap = (DataMap) obj;
collection.add(decodeValue(dataMap, entityDecoder));
}
return collection;
}
Aggregations