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.google.inject.Asserts.java

/**
 * Returns the String that would appear in an error message for this chain of classes 
 * as modules./*from   w  w w .ja  va2s .c o m*/
 */
public static String asModuleChain(Class... classes) {
    return Joiner.on(" -> ").appendTo(new StringBuilder(" (via modules: "),
            Iterables.transform(ImmutableList.copyOf(classes), new Function<Class, String>() {
                @Override
                public String apply(Class input) {
                    return input.getName();
                }
            })).append(")").toString();
}

From source file:com.github.tomakehurst.wiremock.http.HttpHeadersJsonDeserializer.java

private static Function<Map.Entry<String, JsonNode>, HttpHeader> toHttpHeaders() {
    return new Function<Map.Entry<String, JsonNode>, HttpHeader>() {
        @Override/*w  w w. j a va 2 s.  c o m*/
        public HttpHeader apply(Map.Entry<String, JsonNode> field) {
            String key = field.getKey();
            if (field.getValue().isArray()) {
                return new HttpHeader(key,
                        ImmutableList.copyOf(transform(all(field.getValue().elements()), toStringValues())));
            } else {
                return new HttpHeader(key, field.getValue().textValue());
            }
        }
    };
}

From source file:org.apache.james.eventsourcing.eventstore.History.java

public static History of(Event... events) {
    return of(ImmutableList.copyOf(events));
}

From source file:io.github.cloudiator.deployment.domain.ProcessGroupImpl.java

public ProcessGroupImpl(Iterable<CloudiatorProcess> processes) {
    this.processes = ImmutableList.copyOf(processes);
}

From source file:com.opengamma.web.server.push.analytics.AnalyticsColumnGroups.java

AnalyticsColumnGroups(List<AnalyticsColumnGroup> columnGroups) {
    ArgumentChecker.notNull(columnGroups, "columnGroups");
    ArgumentChecker.notNull(columnGroups, "columnGroups");
    for (AnalyticsColumnGroup group : columnGroups) {
        _columns.addAll(group.getColumns());
    }//  w  w w  . j  a va 2  s.  c  o  m
    _columnGroups = ImmutableList.copyOf(columnGroups);
}

From source file:com.opengamma.strata.report.ReportRequirements.java

/**
 * Obtains an instance from the columns.
 *
 * @param columns  the columns to calculate
 * @return the requirements//w  w  w . j av  a2s .  c  o  m
 */
public static ReportRequirements of(Column... columns) {
    return new ReportRequirements(ImmutableList.copyOf(columns));
}

From source file:org.terasology.math.geom.Polygon.java

/**
 * @param vertices a list of vertices (vertices are directly used)
 *//*from   www.jav a 2s  .  c o  m*/
public static Polygon create(List<ImmutableVector2f> vertices) {
    return new Polygon(ImmutableList.copyOf(vertices));
}

From source file:org.glowroot.agent.config.UiConfig.java

public static UiConfig create(AgentConfig.UiConfig config) {
    return ImmutableUiConfig.builder()
            .defaultDisplayedTransactionType(config.getDefaultDisplayedTransactionType())
            .defaultDisplayedPercentiles(ImmutableList.copyOf(config.getDefaultDisplayedPercentileList()))
            .build();//from   w w  w . ja  v a  2 s .  c o  m
}

From source file:com.github.filosganga.geogson.model.LineString.java

/**
 * Creates a LineString from the given points.
 *
 * @param points Sequence of Point composed at least by 2 points.
 * @return a LineString//www. ja  va2s  . co  m
 */
public static LineString of(Point... points) {
    return LineString.of(ImmutableList.copyOf(newArrayList(points)));
}

From source file:com.wrmsr.wava.transform.statementizer.fragment.Fragment.java

public Fragment(List<Node> body) {
    this.body = ImmutableList.copyOf(body);
}