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:com.zimbra.soap.account.message.RevokeRightsRequest.java

public void setAces(Iterable<AccountACEInfo> aces) {
    this.aces.clear();
    if (aces != null) {
        Iterables.addAll(this.aces, aces);
    }/*  w w w  .j  ava  2s .c o m*/
}

From source file:ec.demetra.xml.regression.TsVariableAdapters.java

private void load() {
    Iterable<TsVariableAdapter> all = ServiceLoader.load(TsVariableAdapter.class);
    Iterables.addAll(adapters, all);
}

From source file:org.thiesen.collections.set.impl.MutableTreeSet.java

public static <T> MutableTreeSet<T> copyOf(final Comparator<? super T> comparator, final Iterable<T> elements) {
    final TreeSet<T> newTreeSet = Sets.<T>newTreeSet(comparator);
    Iterables.addAll(newTreeSet, elements);
    return new MutableTreeSet<T>(newTreeSet);
}

From source file:com.zimbra.soap.admin.type.StatsValues.java

public void setStats(Iterable<NameAndValue> stats) {
    this.stats.clear();
    if (stats != null) {
        Iterables.addAll(this.stats, stats);
    }//w ww  .  j av  a  2s. c o m
}

From source file:org.jclouds.vcloud.domain.network.NatService.java

public NatService(boolean enabled, @Nullable NatType type, @Nullable NatPolicy policy,
        Iterable<NatRule> natRules) {
    this.enabled = enabled;
    this.type = type;
    this.policy = policy;
    Iterables.addAll(this.natRules, checkNotNull(natRules, "natRules"));
}

From source file:org.eclipse.osee.orcs.script.dsl.ui.internal.DefaultOrcsObjectProvider.java

@Override
public Iterable<? extends Identifiable<Long>> getArtifactTypes() {
    List<Identifiable<Long>> toReturn = new ArrayList<Identifiable<Long>>();
    for (IOrcsObjectProvider provider : getProviders()) {
        Iterables.addAll(toReturn, provider.getArtifactTypes());
    }/*from   w  ww.  jav a 2s  .  c om*/
    return toReturn;
}

From source file:ec.demetra.xml.calendars.CalendarAdapters.java

private void load() {
    Iterable<CalendarAdapter> all = ServiceLoader.load(CalendarAdapter.class);
    Iterables.addAll(adapters, all);
}

From source file:com.zimbra.soap.account.type.LicenseInfo.java

public void setAttrs(Iterable<LicenseAttr> attrs) {
    if (attrs == null) {
        this.attrs = null;
    } else {//from   ww w .  j a  v a2 s  . c om
        this.attrs = Lists.newArrayList();
        Iterables.addAll(this.attrs, attrs);
    }
}

From source file:com.zimbra.soap.admin.message.UpdateDeviceStatusResponse.java

public void setDevices(Iterable<DeviceInfo> devices) {
    this.devices.clear();
    if (devices != null) {
        Iterables.addAll(this.devices, devices);
    }//w w  w .jav  a2s .co  m
}

From source file:com.google.devtools.build.lib.query2.engine.LoadFilesFunction.java

@Override
public <T> void eval(final QueryEnvironment<T> env, VariableContext<T> context,
        final QueryExpression expression, List<QueryEnvironment.Argument> args, final Callback<T> callback)
        throws QueryException, InterruptedException {
    env.eval(args.get(0).getExpression(), context, new Callback<T>() {
        @Override//from ww  w . j  a v a  2 s. c  o m
        public void process(Iterable<T> partialResult) throws QueryException, InterruptedException {
            Set<T> result = CompactHashSet.create();
            Iterables.addAll(result, partialResult);
            callback.process(env.getBuildFiles(expression, result, /* BUILD */ false, /* subinclude */ false,
                    /* load */ true));
        }
    });
}