当前位置: 首页>>代码示例>>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;未经允许,请勿转载。