String type = contentElement.get("type").getAsString();
String source = contentElement.get("source").getAsString();
Long id = contentElement.get("id") != null ? contentElement.get("id").getAsLong() : null;
if(type==null) {
Error error = new Error("Type field is empty.");
error.apply(request, response);
return;
}
Content.ContentType contentType = Content.ContentType.valueOf(type.toUpperCase());
if(contentType == null) {
Error error = new Error(type + " is not a correct type value.");