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.jclouds.azurecompute.arm.domain.StorageProfile.java

@SerializedNames({ "imageReference", "osDisk", "dataDisks" })
public static StorageProfile create(final ImageReference imageReference, final OSDisk osDisk,
        final List<DataDisk> dataDisks) {
    StorageProfile.Builder builder = StorageProfile.builder().imageReference(imageReference).osDisk(osDisk)
            .dataDisks(dataDisks != null ? ImmutableList.copyOf(dataDisks) : null);

    return builder.build();
}

From source file:com.wrmsr.wava.yen.global.YTable.java

public YTable(List<Name> names) {
    this.names = ImmutableList.copyOf(names);
}

From source file:com.proofpoint.discovery.client.DiscoveryAddressLookup.java

public Collection<InetAddress> get() throws UnknownHostException {
    return ImmutableList.copyOf(InetAddress.getAllByName("discovery"));
}

From source file:org.geogig.osm.internal.history.Way.java

public ImmutableList<Long> getNodes() {
    return ImmutableList.copyOf(nodes);
}

From source file:org.mayocat.store.InvalidEntityException.java

public InvalidEntityException(String message, Iterable<String> errors) {
    super(message);
    this.errors = ImmutableList.copyOf(errors);
}

From source file:com.google.idea.blaze.base.ideinfo.TargetKey.java

/** Returns a key identifying a general target */
public static TargetKey forGeneralTarget(Label label, List<String> aspectIds) {
    if (aspectIds.isEmpty()) {
        return forPlainTarget(label);
    }//from w  w w.  j  av  a  2s  .com
    return new TargetKey(label, ImmutableList.copyOf(aspectIds));
}

From source file:io.pcp.parfait.CompositeCounter.java

public CompositeCounter(Collection<? extends Counter> counters) {
    this.counters = ImmutableList.copyOf(counters);
}

From source file:com.facebook.presto.orc.metadata.BucketStatistics.java

public BucketStatistics(List<Long> bucketCounts) {
    this.bucketCounts = ImmutableList.copyOf(checkNotNull(bucketCounts, "bucketCounts is null"));
}

From source file:org.jclouds.openstack.poppy.v1.domain.Flavor.java

@SerializedNames({ "id", "providers", "links" })
private static Flavor create(String id, List<Provider> providers, Set<Link> links) {
    return new AutoValue_Flavor(id, ImmutableList.copyOf(providers), ImmutableSet.copyOf(links));
}

From source file:org.apache.james.core.User.java

public static User fromUsername(String username) {
    Preconditions.checkNotNull(username);
    Preconditions.checkArgument(!Strings.isNullOrEmpty(username));

    List<String> parts = ImmutableList.copyOf(Splitter.on('@').split(username));
    switch (parts.size()) {
    case 1://  www.j ava 2  s. co m
        return fromLocalPartWithoutDomain(username);
    case 2:
        return fromLocalPartWithDomain(parts.get(0), parts.get(1));
    }
    throw new IllegalArgumentException("The username should not contain multiple domain delimiter.");
}