本文整理汇总了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 );
}
}
}
示例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");
}
示例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;
}
}
}
示例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("") );
}