当前位置: 首页>>代码示例>>Java>>正文


Java ArrayNode.removeAll方法代码示例

本文整理汇总了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 ;
}
 
开发者ID:csap-platform,项目名称:csap-core,代码行数:28,代码来源:ActiveUsers.java

示例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);
}
 
开发者ID:equella,项目名称:Equella,代码行数:35,代码来源:DynamicAclTest.java

示例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");
}
 
开发者ID:equella,项目名称:Equella,代码行数:33,代码来源:WorkflowApiEditTest.java


注:本文中的com.fasterxml.jackson.databind.node.ArrayNode.removeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。