use of org.codehaus.jackson.node.LongNode in project neo4j by neo4j.
the class AbstractRESTInteraction method getValue.
private Object getValue(JsonNode valueNode) {
Object value;
if (valueNode instanceof TextNode) {
value = valueNode.asText();
} else if (valueNode instanceof ObjectNode) {
value = mapValue(valueNode.getFieldNames(), valueNode);
} else if (valueNode instanceof ArrayNode) {
ArrayNode aNode = (ArrayNode) valueNode;
ArrayList<String> listValue = new ArrayList<>(aNode.size());
for (int j = 0; j < aNode.size(); j++) {
listValue.add(aNode.get(j).asText());
}
value = listValue;
} else if (valueNode instanceof IntNode) {
value = valueNode.getIntValue();
} else if (valueNode instanceof LongNode) {
value = valueNode.getLongValue();
} else if (valueNode.isNull()) {
return null;
} else {
throw new RuntimeException(String.format("Unhandled REST value type '%s'. Need String (TextNode), List (ArrayNode), Object (ObjectNode), long (LongNode), or int (IntNode).", valueNode.getClass()));
}
return value;
}
Aggregations