if (node.isNull()) { return null;
private String langSTR(ObjectNode langArg) { if (langArg.isNull()) { return ""; } final String LANGARG = "(lang:\"%s\")"; return String.format(LANGARG, langArg.get("lang").asText()); }
private String langSTR(ObjectNode langArg) { if (langArg.isNull()) { return ""; } final String LANGARG = "(lang:\"%s\")"; return String.format(LANGARG, langArg.get("lang").asText()); }
public UpdateMessagePatch fromJsonNode(ObjectNode updatePatchNode) { if (updatePatchNode == null || updatePatchNode.isNull() || updatePatchNode.isMissingNode()) { throw new IllegalArgumentException("updatePatchNode"); } if (! validator.isValid(updatePatchNode)) { return UpdateMessagePatch.builder() .validationResult(validator.validate(updatePatchNode)) .build(); } try { return jsonParser.readerFor(UpdateMessagePatch.class).<UpdateMessagePatch>readValue(updatePatchNode); } catch (IOException e) { throw new RuntimeException(e); } } }
if (instanceNode == null || instanceNode.isNull()) { throw new IllegalArgumentException("Events must contain a populated instance node");
(ObjectNode) (objectJsonNodeData.at(parentSearchString).get(nodeName)); if (currentValue == null || currentValue.isMissingNode() || currentValue.isEmpty(null) || currentValue.isNull()) { JSONObject nodeDef = null; if (parentSearchString != "/") {
if (node.isNull()) { return null;
public boolean add(ViewDescriptor viewDescriptor, ModelPath modelPath, Id[] modelPathIds, String[] viewPathClasses, ViewValue viewValue, Long timestamp) throws IOException { byte[] value = (viewValue == null) ? null : viewValue.getValue(); viewSizeInBytes += (value == null) ? 0 : value.length; if (viewSizeInBytes > viewMaxSizeInBytes) { LOG.error("ViewDescriptor:" + viewDescriptor + " is larger than viewMaxReadableBytes:" + viewMaxSizeInBytes); return false; } if (viewValue == null || viewValue.getValue() == null || viewValue.getValue().length == 0) { return false; } ObjectNode valueObject = merger.toObjectNode(viewValue.getValue()); if (valueObject == null || valueObject.isNull() || valueObject.size() == 0) { return false; } ObjectId[] modelPathInstanceIds = modelPathInstanceIds(modelPathIds, viewPathClasses, modelPath.getPathMembers()); LOG.debug("Read view path -> with id={} instance ids={} value={} timestamp={}", new Object[]{modelPath.getId(), modelPathIds, viewValue, timestamp}); if (treeRoot == null) { treeRoot = new MapTreeNode(modelPathInstanceIds[0]); } treeRoot.add(modelPath.getPathMembers().toArray(new ModelPathStep[modelPath.getPathMemberSize()]), modelPathInstanceIds, viewValue, timestamp); return true; }