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.metadata.QualifiedObjectName.java

@JsonCreator
public static QualifiedObjectName valueOf(String name) {
    requireNonNull(name, "name is null");

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

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

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

@SerializedNames({ "available", "availableIPAddresses" })
public static IpAddressAvailabilityResult create(final boolean available,
        final List<String> availableIPAddresses) {
    return new AutoValue_IpAddressAvailabilityResult(available,
            availableIPAddresses != null ? ImmutableList.copyOf(availableIPAddresses)
                    : ImmutableList.<String>of());
}

From source file:minium.internal.Modules.java

public static Module<?> combine(final Module<?>... modules) {
    return combine(ImmutableList.copyOf(modules));
}

From source file:google.registry.security.JsonResponseHelper.java

/** Creates a JSON response message securely to the browser client with a parser breaker. */
public static ImmutableMap<String, Object> create(Status status, String message,
        Iterable<? extends Map<String, ?>> results) {
    return ImmutableMap.<String, Object>of("status", status.toString(), "message",
            checkNotNull(message, "message"), "results", ImmutableList.copyOf(results));
}

From source file:com.cdancy.artifactory.rest.domain.storage.FileList.java

@SerializedNames({ "uri", "created", "files" })
public static FileList create(String uri, String created, List<Artifact> files) {
    return new AutoValue_FileList(uri, created,
            files != null ? ImmutableList.copyOf(files) : ImmutableList.<Artifact>of());
}

From source file:com.facebook.presto.raptor.RaptorQueryRunner.java

public static QueryRunner createRaptorQueryRunner(TpchTable<?>... tables) throws Exception {
    return createRaptorQueryRunner(ImmutableList.copyOf(tables));
}

From source file:org.apache.calcite.tools.RuleSets.java

/** Creates a rule set with a given collection of rules. */
public static RuleSet ofList(Iterable<? extends RelOptRule> rules) {
    return new ListRuleSet(ImmutableList.copyOf(rules));
}

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

public static UAnnotatedType create(Iterable<UAnnotation> annotations, UExpression type) {
    return new AutoValue_UAnnotatedType(ImmutableList.copyOf(annotations), type);
}

From source file:net.hydromatic.optiq.tools.RuleSets.java

/** Creates a rule set with a given collection of rules. */
public static RuleSet ofList(Collection<RelOptRule> rules) {
    return new ListRuleSet(ImmutableList.copyOf(rules));
}

From source file:org.apache.curator.x.async.migrations.MigrationSet.java

static MigrationSet build(String id, List<Migration> migrations) {
    Objects.requireNonNull(id, "id cannot be null");
    final List<Migration> migrationsCopy = ImmutableList.copyOf(migrations);
    return new MigrationSet() {
        @Override/*from   w w  w .j ava2 s.  co m*/
        public String id() {
            return id;
        }

        @Override
        public List<Migration> migrations() {
            return migrationsCopy;
        }
    };
}