Method to deserialize the BatchItemResponse object

@param jsonNode the json node
@return BatchItemResponse the batch item response
1186
private BatchItemResponse getBatchItemResponse(JsonNode jsonNode) throws IOException {
		ObjectMapper mapper = new ObjectMapper();

		SimpleModule simpleModule = new SimpleModule("BatchItemResponseDeserializer", new Version(1, 0, 0, null));
		simpleModule.addDeserializer(BatchItemResponse.class, new BatchItemResponseDeserializer());

		mapper.registerModule(simpleModule);
		mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

		return mapper.treeToValue(jsonNode, BatchItemResponse.class);
	}
482938
public ObjectNode toJson() {
		ObjectMapper mapper = new ObjectMapper();
		ObjectNode node = mapper.createObjectNode();
		ObjectNode attributeNode = mapper.createObjectNode();

		node.put(attribute.getCode(), attributeNode);
		attributeNode.put("op", operation.getOp());

		return node;
	}
625149
public String stringify(JsonNode json) {
        try {
            return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
        } catch (JsonProcessingException e) {
            throw new RuntimeException("Cannot stringify the input json node", e);
        }
    }
547266
public static JsonNode remove(ObjectNode obj, String fieldName) {
		JsonNode result = null;
		if (obj != null) {
			result = obj.remove(fieldName);
		}
		return result;
	}
742814
public static byte[] serialize(Node inputNode) throws Exception
	{
		// Initialize sources and targets
		ByteArrayOutputStream serializerOutput = new ByteArrayOutputStream();
		Source sourceObject = new DOMSource(inputNode); 
		Result targetObject = new StreamResult(serializerOutput);
		
		// Create XML Transformer
		TransformerFactory serializerFactory = TransformerFactory.newInstance();
		Transformer serializer = serializerFactory.newTransformer();

		// Set output properties
		serializer.setOutputProperty(OutputKeys.INDENT, "yes");
		serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
		
		// Run serialization transformation
		serializer.transform(sourceObject, targetObject);
		
		// Return output as a byte array
		return serializerOutput.toByteArray();
	}
132216
public JSONObject batch(JSONArray actions, RequestOptions requestOptions) throws AlgoliaException {
    return postBatch(actions, requestOptions);
  }
1024725
public static Node getNode(Model mo, int nodeID) throws JSONConverterException {
        Node n = new Node(nodeID);
        if (!mo.contains(n)) {
            throw new JSONConverterException("Undeclared node '" + nodeID + "'");
        }
        return n;
    }
686449
protected JsonError handleJsonNodeRequest(final JsonNode node, final OutputStream output) throws IOException {
		if (node.isArray()) {
			return handleArray(ArrayNode.class.cast(node), output);
		}
		if (node.isObject()) {
			return handleObject(ObjectNode.class.cast(node), output);
		}
		return this.writeAndFlushValueError(output, this.createResponseError(VERSION, NULL, JsonError.INVALID_REQUEST));
	}
375594
public function theJsonNodeShouldNotExist($jsonNode)
    {
        $e = null;

        try {
            $realValue = $this->evaluateJsonNodeValue($jsonNode);
        } catch (\Exception $e) {
            // If the node does not exist an exception should be throwed
        }

        if ($e === null) {
            throw new WrongJsonExpectation(
                sprintf("The node '%s' exists and contains '%s'.", $jsonNode, json_encode($realValue)),
                $this->readJson(),
                $e
            );
        }
    }
951615
public static JsonNode getValue(JsonNode node, String dPath) {
        return DPathUtils.getValue(node, dPath);
    }
1271661
public static JsonNode readJson(Reader source, ClassLoader classLoader) {
        return SerializationUtils.readJson(source, classLoader);
    }
1159305
private ObjectJS jsonTreeNode(CallTreeNode node, StringifierFactory jsonStringifierFactory) {
		final ObjectJS nodeJS = ObjectJS.create(node, jsonStringifierFactory);
		if (!node.getChildren().isEmpty()) {
			final ArrayJS childNodesJS=new ArrayJS(node.getChildren().size());
			for(CallTreeNode childNode:node.getChildren()) {
				childNodesJS.addElement(jsonTreeNode(childNode, jsonStringifierFactory));
			}
			nodeJS.setAttribute("children", childNodesJS);
		}
		return nodeJS;
	}
191846
private ObjectNode createResponseSuccess(String jsonRpc, Object id, JsonNode result) {
		ObjectNode response = mapper.createObjectNode();
		response.put(JSONRPC, jsonRpc);
		if (Integer.class.isInstance(id)) {
			response.put(ID, Integer.class.cast(id).intValue());
		} else if (Long.class.isInstance(id)) {
			response.put(ID, Long.class.cast(id).longValue());
		} else if (Float.class.isInstance(id)) {
			response.put(ID, Float.class.cast(id).floatValue());
		} else if (Double.class.isInstance(id)) {
			response.put(ID, Double.class.cast(id).doubleValue());
		} else if (BigDecimal.class.isInstance(id)) {
			response.put(ID, BigDecimal.class.cast(id));
		} else {
			response.put(ID, String.class.cast(id));
		}
		response.set(RESULT, result);
		return response;
	}
897589
private CDCResponse getCDCQueryResponse(JsonNode jsonNode) throws IOException {
		ObjectMapper mapper = new ObjectMapper();

		SimpleModule simpleModule = new SimpleModule("CDCQueryResponseDeserializer", new Version(1, 0, 0, null));
		simpleModule.addDeserializer(CDCResponse.class, new CDCQueryResponseDeserializer());

		mapper.registerModule(simpleModule);
		mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

		return mapper.treeToValue(jsonNode, CDCResponse.class);
	}
801220
public static Collection<Attribute> fromJson(ObjectNode object) throws IOException {
        Collection<Attribute> attributes = new HashSet<>();
        convertJsonObject(attributes, object, "", 0, new HashMap<>());

        return attributes;
    }
416242
JsonNode requestResponse(final JsonNode request) {
        try {

            // write request
            String str = request.toString();
            this.stdin.write(str + "\n");
            this.stdin.flush();

            // read response
            JsonNode resp = readNextResponse();

            // throw if this is an error response
            if (resp.has("error")) {
                return processErrorResponse(resp);
            }

            // process synchronous callbacks (which 'interrupt' the response flow).
            if (resp.has("callback")) {
                return processCallbackResponse(resp);
            }

            // null "ok" means undefined result (or void).
            return resp.get("ok");

        } catch (IOException e) {
            throw new JsiiException("Unable to send request to jsii-runtime: " + e.toString(), e);
        }
    }
596507
private Later<JsonNode> createFetcher() {
		final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries);
		
		// This actually creates the correct JSON structure as an array
		String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper);
		if (log.isLoggable(Level.FINEST))
			log.finest("Batch request is: " + batchValue);

		this.addParams(call, new Param[] { new Param("batch", batchValue) });
		
		final HttpResponse response;
		try {
			response = call.execute();
		} catch (IOException ex) {
			throw new IOFacebookException(ex);
		}
		
		return new Later<JsonNode>() {
			@Override
			public JsonNode get() throws FacebookException
			{
				try {
					if (response.getResponseCode() == HttpURLConnection.HTTP_OK
							|| response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST
							|| response.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
						
						// If it was an error, we will recognize it in the content later.
						// It's possible we should capture all 4XX codes here.
						JsonNode result = mapper.readTree(response.getContentStream());
						
						if (log.isLoggable(Level.FINEST))
							log.finest("Response is: " + result);
						
						return result;
					} else {
						throw new IOFacebookException(
								"Unrecognized error " + response.getResponseCode() + " from "
								+ call + " :: " + StringUtils.read(response.getContentStream()));
					}
				} catch (IOException e) {
					throw new IOFacebookException("Error calling " + call, e);
				}
			}
		};
	}