for (Map.Entry<String, R> entry : batchRequest.getEntities().entrySet())
{
Object key = parsedKeyMap.get(entry.getKey());
if (key == null)
{
throw new RoutingException(
String.format("Batch request mismatch, URI keys: '%s' Entity keys: '%s'",
ids.toString(),
batchRequest.getEntities().keySet().toString()),
HttpStatus.S_400_BAD_REQUEST.getCode());
}
R value = DataTemplateUtil.wrap(entry.getValue().data(), valueClass);
result.put(key, value);
}
if (!ids.equals(result.keySet()))
{
throw new RoutingException(
String.format("Batch request mismatch, URI keys: '%s' Entity keys: '%s'",
ids.toString(),
result.keySet().toString()),
HttpStatus.S_400_BAD_REQUEST.getCode());
}