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