Example usage for com.google.common.collect ImmutableList.Builder add

List of usage examples for com.google.common.collect ImmutableList.Builder add

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableList.Builder add.

Prototype

public final void add(int index, E element) 

Source Link

Usage

From source file:dagger.internal.codegen.Compilers.java

/**
 * Returns a compiler that runs the Dagger and {@code @AutoAnnotation} processors, along with
 * extras./*  www .j a  v  a 2s  .c  o  m*/
 */
static Compiler daggerCompiler(Processor... extraProcessors) {
    ImmutableList.Builder<Processor> processors = ImmutableList.builder();
    processors.add(new ComponentProcessor(), new AutoAnnotationProcessor());
    processors.add(extraProcessors);
    return javac().withProcessors(processors.build());
}

From source file:org.sonar.plugins.jacoco.JaCoCoExtensions.java

public static List getExtensions(Version sonarQubeVersion) {
    ImmutableList.Builder<Object> extensions = ImmutableList.builder();

    extensions.addAll(JacocoConfiguration.getPropertyDefinitions(sonarQubeVersion));
    extensions.add(JacocoConfiguration.class,
            // Unit tests
            JaCoCoSensor.class);
    if (!sonarQubeVersion.isGreaterThanOrEqual(JacocoConfiguration.SQ_6_2)) {
        extensions.add(//from w w w  . j av a  2  s  . c  o  m
                // Integration tests
                JaCoCoItSensor.class, JaCoCoOverallSensor.class);
    }

    return extensions.build();
}

From source file:com.facebook.buck.skylark.io.impl.WatchmanGlobber.java

/** Returns an expression for every matched include file should match in order to be returned. */
private static ImmutableList<Object> toMatchExpressions(Collection<String> exclude,
        boolean excludeDirectories) {
    ImmutableList.Builder<Object> matchExpressions = ImmutableList.builder();
    matchExpressions.add("allof", toTypeExpression(excludeDirectories));
    if (!exclude.isEmpty()) {
        matchExpressions.add(toExcludeExpression(exclude));
    }//from  w  w  w . j  a v a2  s. c om
    return matchExpressions.build();
}