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


Java ArrayNode.remove方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.node.ArrayNode.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayNode.remove方法的具體用法?Java ArrayNode.remove怎麽用?Java ArrayNode.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.node.ArrayNode的用法示例。


在下文中一共展示了ArrayNode.remove方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateJmxResultCache

import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
public void updateJmxResultCache ( Map<String, ObjectNode> jmxResultCacheNode ) {
	// String metricFullName = metricsArray[0] + "_" +
	// serviceName;
	ensureJmxStandardCacheInitialized( jmxResultCacheNode );
	String serviceNamePort = serviceInstance.getServiceName_Port();
	ObjectNode serviceCacheNode = jmxResultCacheNode.get( serviceNamePort );

	for ( JmxCommonEnum metric : JmxCommonEnum.values() ) {

		// some jvms are not tomcat, so skip tomcat specific metrics
		if ( !serviceInstance.isTomcatJarsPresent() && metric.isTomcatOnly() ) {
			continue;
		}

		ArrayNode metricResultsArray = ((ArrayNode) serviceCacheNode
			.get( metric.value + "_" + serviceNamePort ));

		metricResultsArray.insert( 0, this.getValue( metric ) );

		if ( metricResultsArray.size() > inMemoryCacheSize ) {
			metricResultsArray.remove( metricResultsArray.size() - 1 );
		}
	}

}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:26,代碼來源:ServiceCollectionResults.java

示例2: testDelete

import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
@Test
public void testDelete()
{
	ObjectNode workflow = Workflows.json("Deleting workflow");
	ObjectNode task1 = Workflows.task(STEP1, "Step 1", false, RestTestConstants.USERID_MODERATOR1,
		RestTestConstants.USERID_MODERATOR2);
	task1.put("unanimousacceptance", true);
	ObjectNode task2 = Workflows.task(STEP2, "Step 2", false, RestTestConstants.USERID_MODERATOR2);
	ObjectNode task3 = Workflows.task(STEP3, "Step 3", false, RestTestConstants.USERID_MODERATOR2);
	Workflows.rootChild(workflow, task1);
	Workflows.rootChild(workflow, task2);
	Workflows.rootChild(workflow, task3);

	workflow = workflows.create(workflow);
	String workflowId = workflows.getId(workflow);
	String collUuid = createSimpleCollection(RestTestConstants.SCHEMA_BASIC, workflowId);

	String itemName = context.getFullName("Deleting item");
	ObjectNode item = items.create(Items.json(collUuid, "item/name", itemName), true);
	ItemId itemId = items.getId(item);

	mod1tasks.accept(itemId, STEP1, null);
	ArrayNode rootChildren = (ArrayNode) workflow.get("root").get("nodes");
	rootChildren.remove(0);
	workflows.editResponse(workflow, workflowId);

	findTaskToModerate(mod2tasks, itemId, STEP2);
	mod2tasks.accept(itemId, STEP2, null);
	mod2tasks.accept(itemId, STEP3, null);
	ObjectNode moderation = items.moderation(itemId);
	ItemStatusAssertions.assertStatus(moderation, "live");
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:33,代碼來源:WorkflowApiEditTest.java

示例3: removeSpeaker

import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
/**
 * Removes BGP speaker from configuration.
 *
 * @param speakerName BGP speaker name
 */
public void removeSpeaker(String speakerName) {
    ArrayNode speakersArray = (ArrayNode) object.get(SPEAKERS);

    for (int i = 0; i < speakersArray.size(); i++) {
        if (speakersArray.get(i).hasNonNull(NAME) &&
                speakersArray.get(i).get(NAME).asText().equals(speakerName)) {
            speakersArray.remove(i);
            return;
        }
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:17,代碼來源:BgpConfig.java

示例4: verifyJsonClone

import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
@Test
public void verifyJsonClone ()
		throws Exception {

	ArrayNode testArray = jacksonMapper.createArrayNode();

	testArray.add( "a" );
	testArray.add( "b" );
	testArray.add( "c" );

	ArrayNode cloneArray = testArray.deepCopy();

	cloneArray.remove( 1 );

	logger.info( "testArray: {}, cloneArray{}", testArray, cloneArray );

	// logger.info( "Missing item: {}",
	// jacksonMapper.createObjectNode().get( "missing" ).asText("") );
}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:20,代碼來源:SimpleTests.java


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