本文整理匯總了Java中org.apache.commons.collections.CollectionUtils.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java CollectionUtils.addAll方法的具體用法?Java CollectionUtils.addAll怎麽用?Java CollectionUtils.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.collections.CollectionUtils
的用法示例。
在下文中一共展示了CollectionUtils.addAll方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: BranchNode
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
/**
* Creates a BranchNode using a logical operator and a list of children.
*
* @param assertionType the node's type
* @param childList the child nodes under this branch node.
*/
protected BranchNode( AssertionType assertionType, ExprNode... childList )
{
super( assertionType );
if ( null == children )
{
this.children = new ArrayList<>( childList.length );
}
CollectionUtils.addAll( children, childList );
}
示例2: isServerSessionWatcher
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
/**
* Checks if a session is registered with the server as a watcher.
*
* @param long sessionId the session ID to check
* @param path the path to check for watchers
* @param type the type of watcher
* @return true if the client session is a watcher on path for the type
*/
private boolean isServerSessionWatcher(long sessionId, String path,
WatcherType type) {
Set<ServerCnxn> cnxns = new HashSet<>();
CollectionUtils.addAll(cnxns, serverFactory.getConnections().iterator());
for (ServerCnxn cnxn : cnxns) {
if (cnxn.getSessionId() == sessionId) {
return getServer(serverFactory).getZKDatabase().getDataTree()
.containsWatcher(path, type, cnxn);
}
}
return false;
}
示例3: getConfiguration
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
@GET
@Path("/configuration")
@Produces(MediaType.APPLICATION_JSON)
public String getConfiguration() {
Configuration c = configurationProvider.get();
Collection<String> keys = new TreeSet<>();
CollectionUtils.addAll(keys, c.getKeys());
StringBuilder sb = new StringBuilder();
for (String key : keys) {
sb.append(key);
sb.append('=');
sb.append(c.getString(key));
sb.append(System.lineSeparator());
}
String data = sb.toString();
Map<String, Object> map = new TreeMap<>();
map.put("data", data);
map.put("size", data.length());
map.put("hash", DigestUtils.md5Hex(data));
return gson.toJson(map);
}
示例4: AbstractEventTriggerMatcher
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
public AbstractEventTriggerMatcher(EventTriggerMatcher... matchers) {
this.matchers = new ArrayList<>();
CollectionUtils.addAll(this.matchers, matchers);
}
示例5: and
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
public AbstractEventTriggerMatcher and(EventTriggerMatcher... matchers) {
CollectionUtils.addAll(this.matchers, matchers);
return new AndEventTriggerMatcher(this.matchers.toArray(new EventTriggerMatcher[]{}));
}
示例6: or
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
public AbstractEventTriggerMatcher or(EventTriggerMatcher... matchers) {
CollectionUtils.addAll(this.matchers, matchers);
return new OrEventTriggerMatcher(this.matchers.toArray(new EventTriggerMatcher[]{}));
}
示例7: getPostponedCustomers
import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
public LinkedList<QCustomer> getPostponedCustomers() {
final LinkedList<QCustomer> list = new LinkedList<>();
CollectionUtils.addAll(list, elements());
return list;
}