當前位置: 首頁>>代碼示例>>Java>>正文


Java CollectionUtils.addAll方法代碼示例

本文整理匯總了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 );
}
 
開發者ID:apache,項目名稱:directory-ldap-api,代碼行數:18,代碼來源:BranchNode.java

示例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;
}
 
開發者ID:didichuxing2,項目名稱:https-github.com-apache-zookeeper,代碼行數:21,代碼來源:RemoveWatchesTest.java

示例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);

}
 
開發者ID:after-the-sunrise,項目名稱:cryptotrader,代碼行數:30,代碼來源:ResteasyContextListener.java

示例4: AbstractEventTriggerMatcher

import org.apache.commons.collections.CollectionUtils; //導入方法依賴的package包/類
public AbstractEventTriggerMatcher(EventTriggerMatcher... matchers) {
    this.matchers = new ArrayList<>();
    CollectionUtils.addAll(this.matchers, matchers);
}
 
開發者ID:riboseinc,項目名稱:aws-codecommit-trigger-plugin,代碼行數:5,代碼來源:AbstractEventTriggerMatcher.java

示例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[]{}));
}
 
開發者ID:riboseinc,項目名稱:aws-codecommit-trigger-plugin,代碼行數:5,代碼來源:AbstractEventTriggerMatcher.java

示例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[]{}));
}
 
開發者ID:riboseinc,項目名稱:aws-codecommit-trigger-plugin,代碼行數:5,代碼來源:AbstractEventTriggerMatcher.java

示例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;
}
 
開發者ID:bcgov,項目名稱:sbc-qsystem,代碼行數:6,代碼來源:QPostponedList.java


注:本文中的org.apache.commons.collections.CollectionUtils.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。