本文整理汇总了Java中com.fasterxml.jackson.databind.node.ArrayNode.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayNode.removeAll方法的具体用法?Java ArrayNode.removeAll怎么用?Java ArrayNode.removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.node.ArrayNode
的用法示例。
在下文中一共展示了ArrayNode.removeAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: allAdminUsers
import com.fasterxml.jackson.databind.node.ArrayNode; //导入方法依赖的package包/类
@Cacheable(CsapCoreService.TIMEOUT_CACHE_60s)
synchronized public ArrayNode allAdminUsers () {
ArrayNode users = jacksonMapper.createArrayNode() ;
// remove calls for other hosts
csapApp.getAllPackages()
.getServiceInstances( "admin" )
.filter( instance -> ! instance.getHostName().equals( Application.getHOST_NAME() ) )
.map( this::getUsersOnRemoteAdmins )
.forEach( users::addAll );
// add the local host entries
users.addAll( getActive() ) ;
// now make them distinct
HashSet<String> uniqueUsers = new HashSet<>() ;
users.forEach( userJson -> uniqueUsers.add( userJson.asText() ));
// Now transform
users.removeAll() ;
uniqueUsers.forEach( users::add );
return users ;
}
示例2: collectionChange
import com.fasterxml.jackson.databind.node.ArrayNode; //导入方法依赖的package包/类
@Test(dependsOnMethods = "createCollection")
public void collectionChange() throws InterruptedException
{
// Create schema/collection
ObjectNode collection = CollectionJson.json(context.getFullName("changeCollection"), schemaId, null);
ArrayNode dynamicRules = collection.with("security").putArray("dynamicRules");
dynamicRules.add(dynamicRule("U", "/item/userToRevoke", "DISCOVER_ITEM", false));
String collectionUuid = collections.getId(collections.create(collection));
String itemName = context.getFullName("collectionChangeItem");
// Add item revoking DISCOVER for other user
ItemId itemId = items.getId(items.create(Items.json(collectionUuid, "/item/name", itemName,
"/item/userToRevoke", USER, "/item/userToRevoke2", RestTestConstants.USERID_AUTOTEST), 45));
// Can see
itemName = "\"" + itemName + "\"";
searchAT.waitForIndex(itemId, itemName);
// Other user can't see
notVisible(searchDY, itemName, USER, itemId);
// Change path to something else
dynamicRules.removeAll();
dynamicRules.add(dynamicRule("U", "/item/userToRevoke2", "DISCOVER_ITEM", false));
collection.put("uuid", collectionUuid);
collections.editId(collection);
// Other user can see
searchDY.waitForIndex(itemId, itemName);
// Can't see
notVisible(searchAT, itemName, RestTestConstants.USERID_AUTOTEST, itemId);
// Delete the rule
dynamicRules.removeAll();
collections.editId(collection);
// Can see
searchAT.waitForIndex(itemId, itemName);
searchDY.waitForIndex(itemId, itemName);
}
示例3: testDeepDelete
import com.fasterxml.jackson.databind.node.ArrayNode; //导入方法依赖的package包/类
@Test
public void testDeepDelete() throws Exception
{
ObjectNode workflow = Workflows.json("Deep delete workflow");
ObjectNode task1 = Workflows.task(STEP1, "Step 1", false, RestTestConstants.USERID_MODERATOR1);
ObjectNode task2 = Workflows.task(STEP2, "Step 2", false, RestTestConstants.USERID_MODERATOR2);
ObjectNode parallel = Workflows.parallel(PARALLEL, "Parallel", true);
Workflows.rootChild(workflow, parallel);
Workflows.child(parallel, task1);
Workflows.child(parallel, task2);
workflow = workflows.create(workflow);
String workflowId = workflows.getId(workflow);
String collUuid = createSimpleCollection(RestTestConstants.SCHEMA_BASIC, workflowId);
String itemName = context.getFullName("Deep delete item");
ItemId itemId = items.getId(items.create(Items.json(collUuid, "item/name", itemName), true));
mod1tasks.accept(itemId, STEP1, null);
ArrayNode rootChildren = (ArrayNode) workflow.get("root").get("nodes");
rootChildren.removeAll();
ObjectNode task3 = Workflows.task(STEP3, "Step 3", false, RestTestConstants.USERID_MODERATOR1);
Workflows.rootChild(workflow, task3);
workflows.editResponse(workflow, workflowId);
ObjectNode moderation = items.moderation(itemId);
mod1tasks.accept(findTaskToModerate(mod1tasks, itemId, STEP3), null);
moderation = items.moderation(itemId);
ItemStatusAssertions.assertStatus(moderation, "live");
}