List of usage examples for com.google.common.collect Iterables addAll
public static <T> boolean addAll(Collection<T> addTo, Iterable<? extends T> elementsToAdd)
From source file:org.apache.isis.viewer.bdd.common.fixtures.AbstractListFixturePeer.java
/** * Lazily populated, and populated only once. *//* w w w. ja v a2 s.c o m*/ protected List<ObjectAdapter> collectionAdapters() { if (objects == null) { objects = new ArrayList<ObjectAdapter>(); Iterables.addAll(objects, collectionContents()); } return objects; }
From source file:org.renjin.cran.PomBuilder.java
private Model buildPom() throws IOException { Model model = new Model(); model.setModelVersion("4.0.0"); model.setArtifactId(description.getPackage()); model.setGroupId("org.renjin.cran"); model.setVersion(description.getVersion() + "-SNAPSHOT"); model.setDescription(description.getDescription()); model.setUrl(description.getUrl());// w w w.j av a 2 s . com // Parent parent = new Parent(); // parent.setGroupId("org.renjin.cran"); // parent.setArtifactId("cran-parent"); // parent.setVersion("0.7.0-SNAPSHOT"); // model.setParent(parent); if (!Strings.isNullOrEmpty(description.getLicense())) { License license = new License(); license.setName(description.getLicense()); model.addLicense(license); } for (Person author : description.getAuthors()) { Developer developer = new Developer(); developer.setName(author.getName()); developer.setEmail(author.getEmail()); model.addDeveloper(developer); } addCoreModule(model, "graphics"); addCoreModule(model, "methods"); Set<PackageDependency> packageDependencies = Sets.newHashSet(); Iterables.addAll(packageDependencies, description.getDepends()); Iterables.addAll(packageDependencies, description.getImports()); for (PackageDependency packageDep : packageDependencies) { if (!packageDep.getName().equals("R")) { model.addDependency(toMavenDependency(packageDep.getName())); } } Plugin renjinPlugin = new Plugin(); renjinPlugin.setGroupId("org.renjin"); renjinPlugin.setArtifactId("renjin-maven-plugin"); renjinPlugin.setVersion(RENJIN_VERSION); PluginExecution compileExecution = compileExecution(); renjinPlugin.addExecution(compileExecution); renjinPlugin.addExecution(legacyCompileExecution()); renjinPlugin.addExecution(testExecution()); Build build = new Build(); build.addPlugin(renjinPlugin); DeploymentRepository snapshotDeploymentRepository = new DeploymentRepository(); snapshotDeploymentRepository.setId("renjin-cran-repo"); snapshotDeploymentRepository .setUrl("http://nexus.bedatadriven.com/content/repositories/renjin-cran-0.7.0/"); snapshotDeploymentRepository.setName("Renjin CRAN Builds"); DistributionManagement distributionManagement = new DistributionManagement(); distributionManagement.setSnapshotRepository(snapshotDeploymentRepository); Repository repository = new Repository(); repository.setId("bedatadriven-public"); repository.setUrl("http://nexus.bedatadriven.com/content/groups/public/"); model.setDistributionManagement(distributionManagement); model.setBuild(build); model.setRepositories(Lists.newArrayList(repository)); model.setPluginRepositories(Lists.newArrayList(repository)); return model; }
From source file:org.apache.brooklyn.api.basic.AbstractBrooklynObjectSpec.java
/** adds the given tags */ public K tags(Iterable<Object> tagsToAdd) { Iterables.addAll(this.tags, tagsToAdd); return self(); }
From source file:com.zimbra.soap.admin.type.AdminKeyValuePairs.java
public void setKeyValuePairs(List<KeyValuePair> keyValuePairs) { if (this.keyValuePairs == null) { this.keyValuePairs = Lists.newArrayList(); }//from ww w .ja v a 2 s.c om this.keyValuePairs.clear(); if (keyValuePairs != null) { Iterables.addAll(this.keyValuePairs, keyValuePairs); } }
From source file:com.zimbra.soap.mail.message.CheckPermissionResponse.java
public void setRights(Iterable<RightPermission> rights) { this.rights.clear(); if (rights != null) { Iterables.addAll(this.rights, rights); }// w ww. ja v a 2 s . c o m }
From source file:eu.interedition.text.xml.ConverterBuilder.java
public ConverterBuilder filter(Iterable<StreamFilter> filters) { Iterables.addAll(this.filters, filters); return this; }
From source file:com.google.javascript.jscomp.RecordFunctionInformation.java
@Override public void process(Node externs, Node root) { NodeTraversal.traverse(compiler, root, this); if (moduleGraph == null) { addModuleInformation(null);/*from w ww . j a v a 2 s .c o m*/ } else { // The test expects a consistent module order. TreeSet<JSModule> modules = Sets.newTreeSet(new Comparator<JSModule>() { public int compare(JSModule o1, JSModule o2) { return o1.getName().compareTo(o2.getName()); } }); Iterables.addAll(modules, moduleGraph.getAllModules()); for (JSModule m : modules) { addModuleInformation(m); } } }
From source file:org.jclouds.cloudwatch.options.ListMetricsOptions.java
/** * A list of dimensions to filter against. * * @param dimensions the dimensions to filter against * * @return this {@code Builder} object//from w w w .ja v a 2 s. com */ public ListMetricsOptions dimensions(Iterable<Dimension> dimensions) { Iterables.addAll(this.dimensions, dimensions); return this; }
From source file:com.torodb.torod.db.backends.query.processors.ProcessorTestUtils.java
private static HashSet<ProcessedQueryCriteriaWrapper> convertProcessedQueryCriteria( Set<ProcessedQueryCriteria> queries) { HashSet<ProcessedQueryCriteriaWrapper> result = Sets.newHashSetWithExpectedSize(queries.size()); Iterables.addAll(result, Iterables.transform(queries, new Function<ProcessedQueryCriteria, ProcessedQueryCriteriaWrapper>() { @Override// ww w .j a v a 2 s . c o m public ProcessedQueryCriteriaWrapper apply(ProcessedQueryCriteria input) { return new ProcessedQueryCriteriaWrapper(input); } })); return result; }
From source file:com.zimbra.soap.mail.type.RecurrenceInfo.java
public void setRules(Iterable<RecurRuleBase> rules) { this.rules.clear(); if (rules != null) { Iterables.addAll(this.rules, rules); }/*from ww w. jav a 2 s.com*/ }