List of usage examples for com.google.common.collect ImmutableList.Builder addAll
boolean addAll(Collection<? extends E> c);
From source file:com.google.api.codegen.transformer.GrpcElementDocTransformer.java
public List<GrpcElementDocView> generateElementDocs(ModelTypeTable typeTable, SurfaceNamer namer, ProtoContainerElement containerElement) { ImmutableList.Builder<GrpcElementDocView> children = ImmutableList.builder(); children.addAll(generateMessageDocs(typeTable, namer, containerElement)); children.addAll(generateEnumDocs(typeTable, namer, containerElement)); return children.build(); }
From source file:com.google.template.soy.soytree.TemplateElementNode.java
@Override public ImmutableList<ExprRootNode> getExprList() { ImmutableList.Builder<ExprRootNode> builder = ImmutableList.builder(); builder.addAll(super.getExprList()); for (TemplateStateVar state : getStateVars()) { builder.add(state.defaultValue()); }/*www .j a va 2 s.c om*/ return builder.build(); }
From source file:org.gradle.platform.base.internal.registry.CollectionBuilderBasedRule.java
private ImmutableList<ModelReference<?>> calculateInputs(List<ModelReference<?>> modelReferences) { final List<ModelReference<?>> references = this.ruleDefinition.getReferences().subList(1, this.ruleDefinition.getReferences().size()); final List<ModelReference<?>> filteredReferences = CollectionUtils.filter(references, new Spec<ModelReference<?>>() { public boolean isSatisfiedBy(ModelReference<?> element) { if (element.getType().equals(ModelType.of(baseType))) { baseTypeParameterIndex = references.indexOf(element) + 1; return false; }/* www .j a v a2s .c om*/ return true; } }); ImmutableList.Builder<ModelReference<?>> allInputs = ImmutableList.builder(); allInputs.addAll(modelReferences); allInputs.addAll(filteredReferences); return allInputs.build(); }
From source file:com.facebook.buck.features.ocaml.OcamlDepToolStep.java
@Override protected ImmutableList<String> getShellCommandInternal(@Nullable ExecutionContext context) { ImmutableList.Builder<String> cmd = ImmutableList.builder(); cmd.addAll(ocamlDepTool.getCommandPrefix(resolver)).add("-one-line").add("-native").addAll(flags) .add("-ml-synonym").add(".re").add("-mli-synonym").add(".rei"); boolean previousFileWasReason = false; for (SourcePath sourcePath : input) { String filePath = resolver.getAbsolutePath(sourcePath).toString(); String ext = Files.getFileExtension(filePath); String dotExt = "." + ext; boolean isImplementation = dotExt.equals(OcamlCompilables.OCAML_ML) || dotExt.equals(OcamlCompilables.OCAML_RE); boolean isReason = dotExt.equals(OcamlCompilables.OCAML_RE) || dotExt.equals(OcamlCompilables.OCAML_REI); if (isReason && !previousFileWasReason) { cmd.add("-pp").add("refmt"); } else if (!isReason && previousFileWasReason) { // Use cat to restore the preprocessor only when the previous file was Reason. cmd.add("-pp").add("cat"); }//from w w w . j a v a2 s .co m // Note -impl and -intf must go after the -pp flag, if any. cmd.add(isImplementation ? "-impl" : "-intf"); cmd.add(filePath); previousFileWasReason = isReason; } return cmd.build(); }
From source file:com.spectralogic.ds3autogen.java.generators.requestmodels.StreamRequestPayloadGenerator.java
/** * Gets the list of Arguments needed to create the request constructor. This * includes all non-void required parameters, arguments described within the * request header, and a Size Argument.//from ww w. ja v a2 s. c o m */ @Override public ImmutableList<Arguments> toConstructorArgumentsList(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> builder = ImmutableList.builder(); builder.addAll(getRequiredArgsFromRequestHeader(ds3Request)); builder.addAll(removeVoidArguments(toArgumentsList(ds3Request.getRequiredQueryParams()))); builder.add(new Arguments("long", "Size")); return builder.build(); }
From source file:com.facebook.buck.cxx.AbstractElfCompactSectionsStep.java
private ImmutableList<String> getObjcopyCommand(ImmutableMap<String, Long> addresses) { ImmutableList.Builder<String> args = ImmutableList.builder(); args.addAll(getObjcopyPrefix()); args.add("--no-change-warnings"); for (Map.Entry<String, Long> ent : addresses.entrySet()) { String section = ent.getKey(); long address = ent.getValue(); args.add("--change-section-address", String.format("%s=0x%x", section, address)); }// www .ja v a2 s . c om args.add(getInputFilesystem().resolve(getInput()).toString()); args.add(getOutputFilesystem().resolve(getOutput()).toString()); return args.build(); }
From source file:com.google.cloud.firestore.BasePath.java
/** * Returns a new path pointing to a child of this Path. * * @param path A relative path/*from www . j av a 2 s . c om*/ */ B append(BasePath<B> path) { ImmutableList.Builder<String> components = ImmutableList.builder(); components.addAll(this.getSegments()); components.addAll(path.getSegments()); return createPathWithSegments(components.build()); }
From source file:com.facebook.buck.cxx.AbstractPreprocessorFlags.java
public Iterable<BuildRule> getDeps(SourcePathRuleFinder ruleFinder) { ImmutableList.Builder<BuildRule> deps = ImmutableList.builder(); deps.addAll(ruleFinder.filterBuildRuleInputs(OptionalCompat.asSet(getPrefixHeader()))); for (CxxHeaders cxxHeaders : getIncludes()) { deps.addAll(cxxHeaders.getDeps(ruleFinder)); }/* w w w . j a va2 s .co m*/ for (FrameworkPath frameworkPath : getFrameworkPaths()) { deps.addAll(frameworkPath.getDeps(ruleFinder)); } return deps.build(); }
From source file:com.google.cloud.firestore.BasePath.java
/** * Returns a new path pointing to a child of this Path. * * @param path A relative path// w ww .jav a 2 s. co m */ B append(String path) { Preconditions.checkArgument(path != null && !path.isEmpty(), "'path' must be a non-empty String"); ImmutableList.Builder<String> components = ImmutableList.builder(); components.addAll(this.getSegments()); components.add(splitChildPath(path)); return createPathWithSegments(components.build()); }
From source file:com.facebook.buck.android.Aapt2Compile.java
@Override public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) { ImmutableList.Builder<Step> steps = ImmutableList.builder(); steps.addAll(MakeCleanDirectoryStep.of(BuildCellRelativePath.fromCellRelativePath( context.getBuildCellRootPath(), getProjectFilesystem(), getOutputPath().getParent()))); steps.add(new Aapt2CompileStep(context.getSourcePathResolver(), getProjectFilesystem().getRootPath(), androidPlatformTarget, context.getSourcePathResolver().getAbsolutePath(resDir), getOutputPath())); steps.add(ZipScrubberStep.of(getProjectFilesystem().resolve(getOutputPath()))); buildableContext.recordArtifact(getOutputPath()); return steps.build(); }