本文整理匯總了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("") );
}