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:org.gradle.api.internal.provider.DefaultListProperty.java

@Override
protected List<T> fromValue(Collection<T> values) {
    return ImmutableList.copyOf(values);
}

From source file:io.airlift.testing.EquivalenceAssertionError.java

public EquivalenceAssertionError(Iterable<ElementCheckFailure> failures) {
    super("Equivalence failed:\n      " + Joiner.on("\n      ").join(failures));
    this.failures = ImmutableList.copyOf(failures);
}

From source file:org.apache.calcite.util.CompositeList.java

/**
 * Creates a CompositeList./* w w w.j  a v a 2  s. c  o  m*/
 *
 * @param lists Constituent lists
 * @param <T>   Element type
 * @return List consisting of all lists
 */
@SafeVarargs
public static <T> CompositeList<T> of(List<? extends T>... lists) {
    //noinspection unchecked
    return new CompositeList<T>((ImmutableList) ImmutableList.copyOf(lists));
}

From source file:io.airlift.event.client.InMemoryEventClient.java

public List<Object> getEvents() {
    return ImmutableList.copyOf(events);
}

From source file:com.opengamma.strata.engine.calculation.CalculationTasks.java

/**
 * @param calculationTasks  the tasks that perform the calculations
 * @param columns  the columns that define the calculations
 *///w  ww . j  a va 2s .com
public CalculationTasks(List<CalculationTask> calculationTasks, List<Column> columns) {
    this.calculationTasks = ImmutableList.copyOf(calculationTasks);
    this.columns = ImmutableList.copyOf(columns);
    List<CalculationRequirements> reqs = calculationTasks.stream().map(CalculationTask::requirements)
            .collect(toList());
    requirements = CalculationRequirements.combine(reqs);

    // Validate the number of tasks and number of columns tally
    if (calculationTasks.size() != 0) {
        if (columns.size() == 0) {
            throw new IllegalArgumentException("There must be at least one column");
        }
        if (calculationTasks.size() % columns.size() != 0) {
            throw new IllegalArgumentException(Messages.format(
                    "Number of tasks ({}) must be exactly divisible by the number of columns ({})",
                    calculationTasks.size(), columns.size()));
        }
    }
}

From source file:org.t3as.ner.conll2003.Sentence.java

public Sentence(final String s, final Collection<ConllToken> tokens) {
    this.sentence = s;
    this.tokens = ImmutableList.copyOf(tokens);
}

From source file:com.chalup.microorm.FieldAdapter.java

protected FieldAdapter(Field field, List<Field> parentFields) {
    mFields = ImmutableList.copyOf(parentFields);
    mField = field;//from  w ww. j av  a2 s.c o  m
    mColumnName = mField.getAnnotation(Column.class).value();
}

From source file:keywhiz.auth.mutualssl.CertificatePrincipal.java

public CertificatePrincipal(String subjectDn, X509Certificate[] chain) {
    this.subjectDn = subjectDn;
    certificateChain = ImmutableList.copyOf(chain);
}

From source file:io.prestosql.plugin.mongodb.MongoTable.java

public MongoTable(MongoTableHandle tableHandle, List<MongoColumnHandle> columns, List<MongoIndex> indexes) {
    this.tableHandle = tableHandle;
    this.columns = ImmutableList.copyOf(columns);
    this.indexes = ImmutableList.copyOf(indexes);
}

From source file:io.airlift.airline.ParseArgumentsUnexpectedException.java

ParseArgumentsUnexpectedException(List<String> unparsedInput) {
    super("Found unexpected parameters: %s", unparsedInput);
    this.unparsedInput = ImmutableList.copyOf(unparsedInput);
}