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.graylog.plugins.collector.configurations.CollectorConfigurationService.java

public List<CollectorConfiguration> loadAll() {
    final DBCursor<CollectorConfiguration> cursor = dbCollection.find();
    final List<CollectorConfiguration> collectorConfigurationList = new ArrayList<>();
    Iterables.addAll(collectorConfigurationList, cursor);
    return collectorConfigurationList;
}

From source file:com.zimbra.soap.mail.type.WatchingTarget.java

public void setItems(Iterable<Id> items) {
    this.items.clear();
    if (items != null) {
        Iterables.addAll(this.items, items);
    }/*  w w w. j  a v  a 2 s . co  m*/
}

From source file:com.zimbra.soap.account.message.GetWhiteBlackListResponse.java

public void setBlackListEntries(Iterable<String> blackListEntries) {
    this.blackListEntries.clear();
    if (blackListEntries != null) {
        Iterables.addAll(this.blackListEntries, blackListEntries);
    }/*from   ww  w.jav a  2s.c o m*/
}

From source file:com.zimbra.soap.mail.type.WatcherInfo.java

public void setItems(Iterable<IntegerIdAttr> items) {
    this.items.clear();
    if (items != null) {
        Iterables.addAll(this.items, items);
    }/*ww  w .j  a v  a 2  s.co  m*/
}

From source file:com.google.copybara.git.ChangeReader.java

private String runLog(Iterable<String> params) throws RepoException {
    List<String> fullParams = new ArrayList<>(Arrays.asList("log", "--no-color", "--date=iso-strict"));
    Iterables.addAll(fullParams, params);
    if (!roots.get(0).isEmpty()) {
        fullParams.add("--");
        fullParams.addAll(roots);/* w  w  w .j  a v  a 2 s  . com*/
    }
    return repository.simpleCommand(fullParams.toArray(new String[0])).getStdout();
}

From source file:com.synflow.cx.internal.instantiation.DependencySolver.java

public void addAll(Iterable<? extends EObject> iterable) {
    Iterables.addAll(eObjects, iterable);
}

From source file:co.cask.cdap.internal.app.services.DefaultServiceConfigurer.java

@Override
public void addHandlers(Iterable<? extends HttpServiceHandler> serviceHandlers) {
    Iterables.addAll(handlers, serviceHandlers);
}

From source file:fr.putnami.pwt.core.widget.client.ErrorGroup.java

@Override
public void displayErrors(Iterable<Error> errors) {
    this.errors.clear();
    Iterables.addAll(this.errors, errors);
}

From source file:org.apache.druid.indexer.path.StaticPathSpec.java

public static void addToMultipleInputs(HadoopDruidIndexerConfig config, Job job, Set<String> paths,
        Class<? extends InputFormat> inputFormatClass) {
    if (paths == null || paths.isEmpty()) {
        return;/*from   w w w .  j  a  va2s . c  om*/
    }

    Class<? extends InputFormat> inputFormatClassToUse = inputFormatClass;
    if (inputFormatClassToUse == null) {
        if (config.isCombineText()) {
            inputFormatClassToUse = CombineTextInputFormat.class;
        } else {
            inputFormatClassToUse = TextInputFormat.class;
        }
    }

    // Due to https://issues.apache.org/jira/browse/MAPREDUCE-5061 we can't directly do
    // MultipleInputs.addInputPath(job, path, inputFormatClassToUse)
    // but have to handle hadoop glob path ourselves correctly
    // This change and HadoopGlobPathSplitter.java can be removed once the hadoop issue is fixed
    Set<String> pathStrings = Sets.newLinkedHashSet();
    for (String path : paths) {
        Iterables.addAll(pathStrings, HadoopGlobPathSplitter.splitGlob(path));
    }
    if (!pathStrings.isEmpty()) {
        addInputPath(job, pathStrings, inputFormatClassToUse);
    }
}

From source file:org.grouplens.lenskit.inject.RecommenderGraphBuilder.java

/**
 * Add roots to the graph builder.//from w  ww  . j a v  a  2 s. com
 * @param classes Root types for the graph.
 * @return The graph builder (for chaining).
 */
public RecommenderGraphBuilder addRoots(Iterable<Class<?>> classes) {
    Iterables.addAll(roots, classes);
    return this;
}