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.spotify.docker.client.messages.swarm.EngineConfig.java

@JsonCreator
static EngineConfig create(@JsonProperty("EngineVersion") final String engineVersion,
        @JsonProperty("Labels") final Map<String, String> labels,
        @JsonProperty("Plugins") final List<EnginePlugin> plugins) {
    final ImmutableMap<String, String> labelsT = labels == null ? null : ImmutableMap.copyOf(labels);

    final ImmutableList<EnginePlugin> pluginsT = plugins == null ? null : ImmutableList.copyOf(plugins);
    return new AutoValue_EngineConfig(engineVersion, labelsT, pluginsT);
}

From source file:org.plos.crepo.model.metadata.RepoCollectionList.java

private static ImmutableList<RepoObjectMetadata> parseObjects(String bucketName, Map<String, Object> raw) {
    List<Map<String, Object>> rawObjects = (List<Map<String, Object>>) raw.get("objects");
    List<RepoObjectMetadata> builtObjects = new ArrayList<>(rawObjects.size());
    for (Map<String, Object> rawObject : rawObjects) {
        builtObjects.add(new RepoObjectMetadata(bucketName, rawObject));
    }/*w w w. java 2 s  . c  om*/
    return ImmutableList.copyOf(builtObjects);
}

From source file:com.cloudera.crunch.impl.mr.emit.IntermediateEmitter.java

public IntermediateEmitter(List<RTNode> children) {
    this.children = ImmutableList.copyOf(children);
}

From source file:io.druid.query.expression.GuiceExprMacroTable.java

@Inject
public GuiceExprMacroTable(final Set<ExprMacro> macros) {
    super(ImmutableList.copyOf(macros));
}

From source file:com.enonic.cms.business.portal.livetrace.HistoryOfPortalRequests.java

public List<PastPortalRequestTrace> getList() {
    synchronized (list) {
        return ImmutableList.copyOf(list);
    }
}

From source file:com.facebook.presto.cli.TsvPrinter.java

public TsvPrinter(List<String> fieldNames, Writer writer, boolean header) {
    this.fieldNames = ImmutableList.copyOf(requireNonNull(fieldNames, "fieldNames is null"));
    this.writer = requireNonNull(writer, "writer is null");
    this.needHeader = header;
}

From source file:com.wrmsr.wava.java.lang.tree.JTrees.java

public static JBlock jblockify(JStatement... statements) {
    return jblockify(ImmutableList.copyOf(statements));
}

From source file:org.apache.aurora.common.args.parsers.RangeParser.java

@Override
public Range<Integer> doParse(String raw) throws IllegalArgumentException {
    ImmutableList<String> numbers = ImmutableList.copyOf(Splitter.on('-').omitEmptyStrings().split(raw));
    try {/*from   w w w . j a va  2  s.c o m*/
        int from = Integer.parseInt(numbers.get(0));
        int to = Integer.parseInt(numbers.get(1));
        if (numbers.size() != 2) {
            throw new IllegalArgumentException("Failed to parse the range:" + raw);
        }
        if (to < from) {
            return Range.closed(to, from);
        } else {
            return Range.closed(from, to);
        }
    } catch (NumberFormatException e) {
        throw new IllegalArgumentException("Failed to parse the range:" + raw, e);
    }
}

From source file:io.airlift.drift.codec.metadata.ConstructorInjection.java

public ConstructorInjection(Constructor<?> constructor, List<ParameterInjection> parameters) {
    this.constructor = constructor;
    this.parameters = ImmutableList.copyOf(parameters);
}

From source file:com.facebook.presto.kudu.KuduQueryRunnerFactory.java

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