JsonNodeFactory factory = JsonNodeFactory.instance;
ObjectNode node = factory.objectNode();
for (Property property : data) {
if (property.hasArray()) {
List<Value> arrValue = property.getArray();
ArrayNode arr = factory.arrayNode();
arr.addAll(arrValue.stream().map(Value::asJson).collect(Collectors.toList()));
node.set(property.getName(), arr);
}
else if (property.hasObject()) {
ObjectNode object = factory.objectNode();