當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectNode.setAll方法代碼示例

本文整理匯總了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;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:12,代碼來源:VirtualLinkCodec.java

示例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;
	}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:53,代碼來源:HostCollector.java

示例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;
}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:7,代碼來源:HostPortal.java


注:本文中的com.fasterxml.jackson.databind.node.ObjectNode.setAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。