List of usage examples for com.google.common.collect ImmutableList.Builder addAll
boolean addAll(Collection<? extends E> c);
From source file:com.facebook.presto.sql.planner.SubPlan.java
/** * Flattens the subplan and returns all PlanFragments in the tree *///from www .j a v a 2s.c o m public List<PlanFragment> getAllFragments() { ImmutableList.Builder<PlanFragment> fragments = ImmutableList.builder(); fragments.add(getFragment()); for (SubPlan child : getChildren()) { fragments.addAll(child.getAllFragments()); } return fragments.build(); }
From source file:com.netflix.bdp.s3mper.metastore.impl.InMemoryMetastore.java
@Override public List<FileInfo> list(List<Path> pathList) throws Exception { synchronized (this) { ImmutableList.Builder<FileInfo> result = new ImmutableList.Builder<FileInfo>(); for (Path path : pathList) { result.addAll(get(path)); }/*from ww w.ja va2s . c om*/ return result.build(); } }
From source file:kr.co.bitnine.octopus.engine.calcite.SimpleCalciteSchema.java
protected void addImplicitFunctionToBuilder(ImmutableList.Builder<Function> builder) { for (String functionName : getSchema().getFunctionNames()) { builder.addAll(getSchema().getFunctions(functionName)); }// ww w . j av a 2 s .co m }
From source file:com.google.devtools.build.lib.analysis.config.transitions.ComposingTransition.java
@Override public List<BuildOptions> apply(BuildOptions buildOptions) { ImmutableList.Builder<BuildOptions> toOptions = ImmutableList.builder(); for (BuildOptions transition1Options : transition1.apply(buildOptions)) { toOptions.addAll(transition2.apply(transition1Options)); }//w w w.j a v a2 s . c om return toOptions.build(); }
From source file:com.facebook.buck.ocaml.OcamlDebugLauncherStep.java
private String getDebugCmd() { ImmutableList.Builder<String> debugCmd = ImmutableList.builder(); debugCmd.add("rlwrap"); debugCmd.addAll(args.ocamlDebug.getCommandPrefix(resolver)); Iterable<String> includesBytecodeDirs = FluentIterable.from(args.ocamlInput) .transformAndConcat(new Function<OcamlLibrary, Iterable<String>>() { @Override/*from ww w. j av a2 s . co m*/ public Iterable<String> apply(OcamlLibrary input) { return input.getBytecodeIncludeDirs(); } }); ImmutableList<String> includesBytecodeFlags = ImmutableList.copyOf(MoreIterables .zipAndConcat(Iterables.cycle(OcamlCompilables.OCAML_INCLUDE_FLAG), includesBytecodeDirs)); debugCmd.addAll(includesBytecodeFlags); debugCmd.addAll(args.bytecodeIncludeFlags); debugCmd.add(args.bytecodeOutput.toString()); return Shell.shellQuoteJoin(debugCmd.build(), " ") + " $@"; }
From source file:ch.raffael.contracts.processor.cel.ast.MethodCall.java
@NotNull @Override// www . j a v a 2 s . c o m protected List<AstNode> children() { ImmutableList.Builder<AstNode> builder = ImmutableList.builder(); if (getSource() != null) { builder.add(getSource()); } return builder.addAll(arguments).build(); }
From source file:com.facebook.buck.features.haskell.HaskellHaddockRule.java
@Override public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) { SourcePathResolver resolver = context.getSourcePathResolver(); String name = getBuildTarget().getShortName(); LOG.info(name);//w w w . j a v a 2 s .c o m ImmutableList.Builder<Step> steps = ImmutableList.builder(); steps.addAll(MakeCleanDirectoryStep.of(BuildCellRelativePath .fromCellRelativePath(context.getBuildCellRootPath(), getProjectFilesystem(), getOutputDir()))); steps.add(new HaddockStep(getProjectFilesystem().getRootPath(), context)); // Copy the generated data from dependencies into our output directory Path haddockOutputDir = getHaddockOuptutDir(); for (SourcePath odir : outputDirs) { steps.add(CopyStep.forDirectory(getProjectFilesystem(), resolver.getRelativePath(odir), haddockOutputDir, CopyStep.DirectoryMode.CONTENTS_ONLY)); } buildableContext.recordArtifact(getOutputDir()); return steps.build(); }
From source file:ch.ledcom.maven.sitespeed.analyzer.SiteSpeedAnalyzer.java
private ImmutableList<String> constructCommand(URL url) { ImmutableList.Builder<String> builder = ImmutableList.builder(); builder.addAll(baseCommand); builder.add(url.toExternalForm());/*from w w w . j a v a 2 s. c o m*/ return builder.build(); }
From source file:cz.cuni.mff.ms.brodecva.botnicek.ide.aiml.elements.template.implementations.MultiPredicateCondition.java
@Override public List<Element> getChildren() { final ImmutableList.Builder<Element> resultBuilder = ImmutableList.builder(); resultBuilder.addAll(this.items); if (this.defaultItem.isPresent()) { resultBuilder.add(this.defaultItem.get()); }/*from w w w. j ava 2 s .co m*/ return resultBuilder.build(); }
From source file:org.lenskit.data.dao.Query.java
/** * Get the results of this query as a list. * @return A list of the results of this query. *///from w w w . j a v a2 s . co m public List<E> get() { ImmutableList.Builder<E> builder = ImmutableList.builder(); try (ObjectStream<E> stream = stream()) { builder.addAll(stream); } return builder.build(); }