Example usage for com.google.common.collect Iterables addAll

List of usage examples for com.google.common.collect Iterables addAll

Introduction

In this page you can find the example usage for com.google.common.collect Iterables addAll.

Prototype

public static <T> boolean addAll(Collection<T> addTo, Iterable<? extends T> elementsToAdd) 

Source Link

Document

Adds all elements in iterable to collection .

Usage

From source file:org.jclouds.aws.ec2.domain.Permission.java

public Permission(Iterable<String> userIds, Iterable<String> groups) {
    Iterables.addAll(this.userIds, checkNotNull(userIds, "userIds"));
    Iterables.addAll(this.groups, checkNotNull(groups, "groups"));
}

From source file:org.geogit.storage.sqlite.PathToRootWalker.java

@Override
public List<ObjectId> next() {
    List<ObjectId> curr = Lists.newArrayList();
    List<ObjectId> next = Lists.newArrayList();

    while (!q.isEmpty()) {
        ObjectId node = q.poll();/*from w  w w  . j  a  va2  s.c  o  m*/
        curr.add(node);

        Iterables.addAll(next,
                Iterables.transform(graph.outgoing(node.toString(), cx), StringToObjectId.INSTANCE));
    }

    seen.addAll(curr);
    q.addAll(next);
    return curr;
}

From source file:org.obiba.opal.core.service.security.realm.SubjectPermissionsConverterRegistry.java

public Iterable<String> convert(Iterable<Permissions> permissions) {
    List<String> perms = Lists.newArrayList();
    for (Permissions sp : permissions) {
        for (String p : sp.getPermissions()) {
            Iterables.addAll(perms, convert(sp.getDomain(), sp.getNode(), p));
        }//from   ww w.j  a  v a  2s. c o m
    }
    return perms;
}

From source file:org.jclouds.azure.storage.domain.internal.BoundedHashSet.java

public BoundedHashSet(Iterable<T> contents, URI url, String prefix, String marker, Integer maxResults,
        String nextMarker) {//from w  w w.  ja  v  a  2 s.c  o m
    Iterables.addAll(this, contents);
    this.url = url;
    this.prefix = prefix;
    this.nextMarker = nextMarker;
    this.maxResults = maxResults;
    this.marker = marker;
}

From source file:com.ning.billing.analytics.dao.BusinessAccountMapper.java

@Override
public BusinessAccount map(final int index, final ResultSet r, final StatementContext ctx) throws SQLException {
    final List<String> tags = new ArrayList<String>();
    Iterables.addAll(tags, splitter.split(r.getString(5)));

    final BusinessAccount account = new BusinessAccount(r.getString(1), BigDecimal.valueOf(r.getDouble(4)),
            tags, new DateTime(r.getLong(6), DateTimeZone.UTC), BigDecimal.valueOf(r.getDouble(7)),
            r.getString(8), r.getString(9), r.getString(10), r.getString(11));
    account.setCreatedDt(new DateTime(r.getLong(2), DateTimeZone.UTC));
    account.setUpdatedDt(new DateTime(r.getLong(3), DateTimeZone.UTC));

    return account;
}

From source file:gaffer.export.SetExporter.java

@Override
protected void _add(final Iterable<?> values, final User user) {
    Iterables.addAll(export, values);
}

From source file:uk.gov.gchq.gaffer.operation.impl.export.set.SetExporter.java

@Override
public void add(final String key, final Iterable<?> results) {
    Iterables.addAll(getExport(key), results);
}

From source file:org.jclouds.vcloud.domain.ovf.System.java

public System(int id, String name, String identifier, Iterable<String> virtualSystemTypes) {
    this.id = id;
    this.name = checkNotNull(name, "name");
    this.identifier = checkNotNull(identifier, "identifier");
    Iterables.addAll(this.virtualSystemTypes, checkNotNull(virtualSystemTypes, "virtualSystemTypes"));

}

From source file:org.locationtech.geogig.storage.memory.PathToRootWalker.java

@Override
public List<Node> next() {
    List<Node> curr = Lists.newArrayList();
    List<Node> next = Lists.newArrayList();

    while (!q.isEmpty()) {
        Node node = q.poll();//from   w  w  w  .  j  a  v  a2s.  c  o  m
        curr.add(node);

        Iterables.addAll(next, node.to());
    }

    seen.addAll(curr);
    q.addAll(next);
    return curr;
}

From source file:org.amanzi.awe.charts.model.impl.ChartDataFilter.java

/**
 * create filter to check appropriation between periods and groups
 * /*from   ww  w  .  j  a v  a  2  s  . com*/
 * @param minRowPeriod
 * @param maxRowPeriod
 * @param groups
 */
public ChartDataFilter(long minRowPeriod, long maxRowPeriod, Iterable<String> groups) {
    this.minRowPeriod = minRowPeriod;
    this.maxRowPeriod = maxRowPeriod;
    Iterables.addAll(this.groups, groups);
}