Example usage for com.google.common.collect ImmutableList copyOf

List of usage examples for com.google.common.collect ImmutableList copyOf

Introduction

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

Prototype

public static <E> ImmutableList<E> copyOf(E[] elements) 

Source Link

Usage

From source file:com.facebook.presto.connector.thrift.ThriftPlugin.java

private static ThriftPluginInfo getPluginInfo() {
    ClassLoader classLoader = ThriftPlugin.class.getClassLoader();
    ServiceLoader<ThriftPluginInfo> loader = ServiceLoader.load(ThriftPluginInfo.class, classLoader);
    List<ThriftPluginInfo> list = ImmutableList.copyOf(loader);
    return list.isEmpty() ? new ThriftPluginInfo() : getOnlyElement(list);
}

From source file:com.facebook.presto.benchmark.driver.BenchmarkResultsPrinter.java

private static List<String> getSelectedQueryTagNames(Iterable<Suite> suites, Iterable<BenchmarkQuery> queries) {
    SortedSet<String> tags = new TreeSet<>();
    for (Suite suite : suites) {
        for (BenchmarkQuery query : suite.selectQueries(queries)) {
            tags.addAll(query.getTags().keySet());
        }//  ww w  .  j a v a 2s.c o  m

        for (RegexTemplate regexTemplate : suite.getSchemaNameTemplates()) {
            tags.addAll(regexTemplate.getFieldNames());
        }
    }
    return ImmutableList.copyOf(tags);
}

From source file:com.opengamma.strata.calc.config.CompositeReportingRules.java

/**
 * Obtains an instance based on the specified rule sets.
 * // ww w. j  av a2s  . c om
 * @param rules  the rule sets to combine
 * @return the combined rule sets
 */
public static CompositeReportingRules of(ReportingRules... rules) {
    return new CompositeReportingRules(ImmutableList.copyOf(rules));
}

From source file:com.cloudera.crunch.impl.mem.MemPipeline.java

public static <T> PCollection<T> collectionOf(T... ts) {
    return new MemCollection<T>(ImmutableList.copyOf(ts));
}

From source file:com.facebook.swift.parser.model.IntegerEnum.java

public IntegerEnum(String name, List<IntegerEnumField> fields) {
    this.name = checkNotNull(name, "name");
    this.fields = ImmutableList.copyOf(checkNotNull(fields, "fields"));
}

From source file:org.eclipse.mylyn.internal.wikitext.html.core.CompositeSpanStrategy.java

CompositeSpanStrategy(List<SpanStrategy> delegates) {
    this.delegates = ImmutableList.copyOf(delegates);
}

From source file:com.liveramp.megadesk.base.state.MultiLock.java

public MultiLock(Collection<Lock> locks) {
    this.locks = ImmutableList.copyOf(locks);
    this.acquiredLocks = Sets.newHashSet();
}

From source file:com.spotify.heroic.metric.WriteResult.java

public static WriteResult of(Collection<Long> times) {
    return new WriteResult(EMPTY_ERRORS, ImmutableList.copyOf(times));
}

From source file:ru.codeinside.gses.webui.form.FormFlow.java

public ImmutableList<Form> getForms() {
    return ImmutableList.copyOf(forms);
}

From source file:com.google.errorprone.refaster.UPlaceholderStatement.java

static UPlaceholderStatement create(PlaceholderMethod placeholder, Iterable<? extends UExpression> arguments,
        ControlFlowVisitor.Result implementationFlow) {
    ImmutableList<UVariableDecl> placeholderParams = placeholder.parameters().asList();
    ImmutableList<UExpression> argumentsList = ImmutableList.copyOf(arguments);
    ImmutableMap.Builder<UVariableDecl, UExpression> builder = ImmutableMap.builder();
    for (int i = 0; i < placeholderParams.size(); i++) {
        builder.put(placeholderParams.get(i), argumentsList.get(i));
    }//www .j a va 2  s . c  o m
    return new AutoValue_UPlaceholderStatement(placeholder, builder.build(), implementationFlow);
}