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.onos.yangtools.yang.data.api.FixedYangInstanceIdentifier.java

static FixedYangInstanceIdentifier create(final Iterable<? extends PathArgument> path, final int hash) {
    return new FixedYangInstanceIdentifier(ImmutableList.copyOf(path), hash);
}

From source file:com.onboard.domain.transform.CompanyTransform.java

public static CompanyDTO companyAndProjectsToCompanyDTO(Company company, List<Project> projects) {
    CompanyDTO companyDTO = new CompanyDTO();
    BeanUtils.copyProperties(company, companyDTO);
    companyDTO.setProjects(//from  w w  w  . j a v  a 2s . com
            ImmutableList.copyOf(Lists.transform(projects, ProjectTransform.PROJECT_DTO_FUNCTION)));
    return companyDTO;
}

From source file:com.google.template.soy.data.internal.ListImpl.java

/** Creates a Soy list implementation backed by the given list. */
public static ListImpl forProviderList(List<? extends SoyValueProvider> providerList) {
    return new ListImpl(ImmutableList.copyOf(providerList));
}

From source file:org.jclouds.azurecompute.arm.domain.ExtensionProfile.java

@SerializedNames({ "extensions" })
public static ExtensionProfile create(final List<Extension> extensions) {
    return new AutoValue_ExtensionProfile(
            extensions == null ? ImmutableList.<Extension>of() : ImmutableList.copyOf(extensions));
}

From source file:net.gageot.test.mocks.MockitoMatchers.java

@SuppressWarnings("unchecked")
public static <T> List<T> eqIterable(final T... values) {
    return argThat(new ArgumentMatcher<List<T>>() {
        @Override/*  w  w w. j a v a2s.  co m*/
        public boolean matches(Object argument) {
            return Iterables.elementsEqual((Iterable<T>) argument, ImmutableList.copyOf(values));
        }
    });
}

From source file:com.google.errorprone.CompositeCodeTransformer.java

public static CodeTransformer compose(Iterable<? extends CodeTransformer> transformers) {
    return new AutoValue_CompositeCodeTransformer(ImmutableList.copyOf(transformers));
}

From source file:com.facebook.presto.metadata.QualifiedTableName.java

@JsonCreator
public static QualifiedTableName valueOf(String tableName) {
    requireNonNull(tableName, "tableName is null");

    ImmutableList<String> ids = ImmutableList.copyOf(Splitter.on('.').split(tableName));
    checkArgument(ids.size() == 3, "Invalid tableName %s", tableName);

    return new QualifiedTableName(ids.get(0), ids.get(1), ids.get(2));
}

From source file:com.opengamma.strata.calc.runner.function.result.ScenarioResult.java

/**
 * Obtains an instance from the specified array of values.
 *
 * @param <T>  the type of the result
 * @param values  the values, one value for each scenario
 * @return an instance with the specified values
 *//* ww w. j  a  v a  2 s  . c om*/
@SafeVarargs
public static <T> ScenarioResult<T> of(T... values) {
    return of(ImmutableList.copyOf(values));
}