List of usage examples for com.google.common.collect ImmutableList copyOf
public static <E> ImmutableList<E> copyOf(E[] elements)
From source file:com.facebook.presto.plugin.postgresql.PostgreSqlQueryRunner.java
public static QueryRunner createPostgreSqlQueryRunner(TestingPostgreSqlServer server, TpchTable<?>... tables) throws Exception { return createPostgreSqlQueryRunner(server, ImmutableList.copyOf(tables)); }
From source file:com.cdancy.artifactory.rest.domain.search.SearchBuildArtifacts.java
@SerializedNames({ "buildName", "buildNumber", "buildStatus", "repos", "mappings" }) public static SearchBuildArtifacts create(String buildName, String buildNumber, String buildStatus, List<String> repos, List<Mapping> mappings) { return new AutoValue_SearchBuildArtifacts(buildName, buildNumber, buildStatus, repos != null ? ImmutableList.copyOf(repos) : null, mappings != null ? ImmutableList.copyOf(mappings) : null); }
From source file:org.apache.james.eventsourcing.eventstore.History.java
public static History of(List<Event> events) { return new History(ImmutableList.copyOf(events)); }
From source file:org.lanternpowered.api.script.function.condition.Condition.java
static AndCondition and(Iterable<Condition> conditions) { return new AndCondition(ImmutableList.copyOf(conditions)); }
From source file:org.lanternpowered.server.script.transformer.SequentialTransformer.java
public static SequentialTransformer of(Transformer... transformers) { return new SequentialTransformer(ImmutableList.copyOf(transformers)); }
From source file:com.google.javascript.jscomp.newtypes.QualifiedName.java
public static QualifiedName fromNode(Node qnameNode) { if (qnameNode == null || !qnameNode.isQualifiedName()) { return null; }//w ww . j av a2 s . c om return qnameNode.isName() ? new QualifiedName(qnameNode.getString()) : new QualifiedName(ImmutableList.copyOf(Splitter.on('.').split(qnameNode.getQualifiedName()))); }
From source file:org.ldp4j.application.sdk.HttpRequestSupport.java
protected static ImmutableElement createElement(String element, ImmutableElementParameter... parameters) { return new ImmutableElement(element, ImmutableList.copyOf(parameters)); }
From source file:com.groupon.mesos.util.UPID.java
public static UPID create(final String master) { checkNotNull(master, "master is null"); final List<String> parts = ImmutableList .copyOf(Splitter.on(CharMatcher.anyOf(":@")).limit(3).split(master)); checkState(parts.size() == 3, "%s is not a valid master definition", master); Integer ip = null;/*w w w. ja va 2 s .c om*/ try { ip = resolveIp(parts.get(1)); } catch (final IOException e) { LOG.warn("Could not resolve %s: %s", parts.get(1), e.getMessage()); } return new UPID(parts.get(0), HostAndPort.fromParts(parts.get(1), Integer.parseInt(parts.get(2))), ip); }
From source file:org.lanternpowered.server.script.transformer.FirstSuccessTransformer.java
public static FirstSuccessTransformer of(Transformer... transformers) { return new FirstSuccessTransformer(ImmutableList.copyOf(transformers)); }
From source file:chess_.engine.classic.player.ai.PawnStructureAnalyzer.java
private static List<List<Boolean>> initColumns() { final List<List<Boolean>> columns = new ArrayList<>(); columns.add(BoardUtils.INSTANCE.FIRST_COLUMN); columns.add(BoardUtils.INSTANCE.SECOND_COLUMN); columns.add(BoardUtils.INSTANCE.THIRD_COLUMN); columns.add(BoardUtils.INSTANCE.FOURTH_COLUMN); columns.add(BoardUtils.INSTANCE.FIFTH_COLUMN); columns.add(BoardUtils.INSTANCE.SIXTH_COLUMN); columns.add(BoardUtils.INSTANCE.SEVENTH_COLUMN); columns.add(BoardUtils.INSTANCE.EIGHTH_COLUMN); return ImmutableList.copyOf(columns); }