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.packet.domain.Plan.java

@SerializedNames({ "id", "slug", "name", "description", "line", "specs", "available_in", "pricing" })
public static Plan create(final String id, String slug, String name, String description, String line,
        Specs specs, List<Href> availableIn, Pricing pricing) {
    return new AutoValue_Plan(id, slug, name, description, line, specs,
            availableIn == null ? ImmutableList.<Href>of() : ImmutableList.copyOf(availableIn), pricing);
}

From source file:com.google.u2f.gaedemo.storage.UserTokens.java

public Collection<TokenStorageData> getTokens() {
    return ImmutableList.copyOf(tokens);
}

From source file:jflowmap.util.ArrayUtils.java

public static double[] toArrayOfPrimitives(Iterable<Double> data) {
    if (data instanceof Collection) {
        return Doubles.toArray((Collection<Double>) data);
    } else {/*from ww  w  .j ava2 s. c  om*/
        return Doubles.toArray(ImmutableList.copyOf(data));
    }
}

From source file:name.martingeisse.minimal.mcode.MCodeBuilder.java

/**
 * Builds the MCode sequence./*from ww w .  j  a  va2s . co m*/
 * 
 * @return the MCode sequence
 */
public ImmutableList<MCodeEntry> build() {
    // TODO patch labels
    return ImmutableList.copyOf(code);
}

From source file:com.spotify.hamcrest.jackson.IsJsonArray.java

public static Matcher<JsonNode> jsonArray(final ArrayNode value) {
    return jsonArray(is(ImmutableList.copyOf(value)));
}

From source file:com.facebook.presto.block.BlockIterables.java

public static BlockIterable createBlockIterable(Iterable<? extends Block> blocks) {
    TupleInfo tupleInfo = Iterables.get(blocks, 0).getTupleInfo();
    return new StaticBlockIterable(tupleInfo, ImmutableList.copyOf(blocks));
}

From source file:com.axemblr.service.cm.models.hosts.MetricList.java

@JsonCreator
public MetricList(@JsonProperty("items") List<Metric> items) {
    this.items = (items == null) ? ImmutableList.<Metric>of() : ImmutableList.copyOf(items);
}

From source file:com.google.testing.junit.runner.junit4.JUnit4RunnerModule.java

public static JUnit4RunnerModule create(Class<?> suite, List<String> args) {
    JUnit4Options options = JUnit4Options.parse(System.getenv(), ImmutableList.copyOf(args));
    JUnit4Config config = new JUnit4Config(options.getTestIncludeFilter(), options.getTestExcludeFilter(),
            Optional.<Path>absent());
    return new JUnit4RunnerModule(suite, config, ImmutableList.copyOf(options.getUnparsedArgs()));
}

From source file:com.opengamma.strata.basics.CalculationTargetList.java

/**
 * Obtains an instance from a list of targets.
 * /*from  w w w .  j a  v  a  2s.c  o m*/
 * @param targets  the list of targets
 * @return the list of targets
 */
public static CalculationTargetList of(List<? extends CalculationTarget> targets) {
    return new CalculationTargetList(ImmutableList.copyOf(targets));
}

From source file:com.github.jcustenborder.kafka.connect.utils.config.TaskConfigs.java

/**
 * Method is used to generate a list of taskConfigs based on the supplied settings.
 *
 * @param settings/*from  w w w .  j a  va  2  s  .  co m*/
 * @param taskCount
 * @return
 */
public static List<Map<String, String>> multiple(Map<String, String> settings, final int taskCount) {
    Preconditions.checkNotNull(settings, "settings cannot be null.");
    Preconditions.checkState(taskCount > 0, "taskCount must be greater than 0.");
    final List<Map<String, String>> result = new ArrayList<>(taskCount);
    for (int i = 0; i < taskCount; i++) {
        result.add(settings);
    }
    return ImmutableList.copyOf(result);
}