本文整理汇总了Java中com.fasterxml.jackson.databind.node.ObjectNode.setAll方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectNode.setAll方法的具体用法?Java ObjectNode.setAll怎么用?Java ObjectNode.setAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.node.ObjectNode
的用法示例。
在下文中一共展示了ObjectNode.setAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encode
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
@Override
public ObjectNode encode(VirtualLink vLink, CodecContext context) {
checkNotNull(vLink, NULL_OBJECT_MSG);
ObjectNode result = context.mapper().createObjectNode()
.put(NETWORK_ID, vLink.networkId().toString());
JsonCodec<Link> codec = context.codec(Link.class);
ObjectNode linkResult = codec.encode(vLink, context);
result.setAll(linkResult);
return result;
}
示例2: buildSummaryReport
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
protected JsonNode buildSummaryReport(boolean isSecondary) {
// Step 1 - build map with total for services
ObjectNode summaryTotalJson = jacksonMapper.createObjectNode();
ArrayNode cache = summary24HourCache;
if (isSecondary)
cache = summary24HourApplicationCache;
logger.debug("** intervalReports size: {}, isSecondary: {}", cache.size(), isSecondary);
for (JsonNode intervalReport : cache) {
Iterator<String> fields = intervalReport.fieldNames();
while (fields.hasNext()) {
String field = fields.next();
ObjectNode serviceInterval = (ObjectNode) intervalReport.get(field);
if (!summaryTotalJson.has(field))
summaryTotalJson.putObject(field);
ObjectNode serviceSummaryNode = (ObjectNode) summaryTotalJson.get(field);
Iterator<String> subFields = serviceInterval.fieldNames();
while (subFields.hasNext()) {
String subField = subFields.next();
// logger.info(" subField: " + subField);
addItemToTotals(serviceInterval, serviceSummaryNode, subField);
}
}
}
// Step 2 convert to mongo aggregation friendly array
ArrayNode summaryArray = jacksonMapper.createArrayNode();
Iterator<String> serviceNames = summaryTotalJson.fieldNames();
while (serviceNames.hasNext()) {
String serviceName = serviceNames.next();
ObjectNode serviceItem = summaryArray.addObject();
serviceItem.put("serviceName", serviceName);
ObjectNode serviceData = (ObjectNode) summaryTotalJson.get(serviceName);
serviceItem.setAll(serviceData);
}
logger.debug("** Report: {}", summaryArray);
return summaryArray;
}
示例3: buildMetricLabels
import com.fasterxml.jackson.databind.node.ObjectNode; //导入方法依赖的package包/类
private ObjectNode buildMetricLabels() {
ObjectNode labelMapping = JmxCommonEnum.graphLabels();
labelMapping.setAll( OsSharedEnum.graphLabels() );
labelMapping.setAll( OsProcessEnum.graphLabels() );
return labelMapping;
}