Java Code Examples for org.apache.commons.collections.CollectionUtils.addAll()

The following are Jave code examples for showing how to use addAll() of the org.apache.commons.collections.CollectionUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: directory-ldap-api   File: BranchNode.java   View Source Code Vote up 5 votes
/**
 * 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 );
}
 
Example 2
Project: https-github.com-apache-zookeeper   File: RemoveWatchesTest.java   View Source Code Vote up 5 votes
/**
 * 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;
}
 
Example 3
Project: cryptotrader   File: ResteasyContextListener.java   View Source Code Vote up 5 votes
@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);

}
 
Example 4
Project: aws-codecommit-trigger-plugin   File: AbstractEventTriggerMatcher.java   View Source Code Vote up 4 votes
public AbstractEventTriggerMatcher(EventTriggerMatcher... matchers) {
    this.matchers = new ArrayList<>();
    CollectionUtils.addAll(this.matchers, matchers);
}
 
Example 5
Project: aws-codecommit-trigger-plugin   File: AbstractEventTriggerMatcher.java   View Source Code Vote up 4 votes
public AbstractEventTriggerMatcher and(EventTriggerMatcher... matchers) {
    CollectionUtils.addAll(this.matchers, matchers);
    return new AndEventTriggerMatcher(this.matchers.toArray(new EventTriggerMatcher[]{}));
}
 
Example 6
Project: aws-codecommit-trigger-plugin   File: AbstractEventTriggerMatcher.java   View Source Code Vote up 4 votes
public AbstractEventTriggerMatcher or(EventTriggerMatcher... matchers) {
    CollectionUtils.addAll(this.matchers, matchers);
    return new OrEventTriggerMatcher(this.matchers.toArray(new EventTriggerMatcher[]{}));
}
 
Example 7
Project: sbc-qsystem   File: QPostponedList.java   View Source Code Vote up 4 votes
public LinkedList<QCustomer> getPostponedCustomers() {
    final LinkedList<QCustomer> list = new LinkedList<>();
    CollectionUtils.addAll(list, elements());
    return list;
}