List of usage examples for com.google.common.collect ImmutableList copyOf
public static <E> ImmutableList<E> copyOf(E[] elements)
From source file:com.teradata.benchto.service.utils.BenchmarkUniqueNameUtils.java
public static String generateBenchmarkUniqueName(String benchmarkName, Map<String, String> benchmarkVariables) { StringBuilder generatedName = new StringBuilder(benchmarkName); List<String> orderedVariableNames = ImmutableList .copyOf(Ordering.natural().sortedCopy(benchmarkVariables.keySet())); for (String variableName : orderedVariableNames) { generatedName.append('_'); generatedName.append(variableName); generatedName.append('='); generatedName.append(benchmarkVariables.get(variableName)); }/*from w ww. ja v a 2s . c o m*/ // leaves in benchmark name only alphanumerics, underscores and dashes return generatedName.toString().replaceAll("[^A-Za-z0-9_=-]", "_"); }
From source file:io.sidecar.query.RawEventsAnswer.java
public static RawEventsAnswer fromEvents(Event... events) { return new RawEventsAnswer(ImmutableList.copyOf(events)); }
From source file:io.v.android.apps.namespace_browser.Namespace.java
/** * Returns the list of entries mounted under the provided namespace root. * * @param root root of the namespace/*from w w w.j av a 2s .c o m*/ * @return list of entries mounted under the provided root. * @throws VException if there was an error fetching the entries. */ public static List<GlobReply> glob(String root, VContext ctx) throws VException { io.v.v23.namespace.Namespace n = V.getNamespace(ctx); VContext ctxT = ctx.withTimeout(new Duration(20000)); // 20s return ImmutableList.copyOf(n.glob(ctxT, root.isEmpty() ? "*" : root + "/*")); }
From source file:io.sidecar.util.CollectionUtils.java
public static <T> ImmutableList<T> filterNulls(List<T> orig) { if (orig == null) { return ImmutableList.of(); }/* w w w .ja va2s.co m*/ return ImmutableList.copyOf(Iterables.filter(orig, new Predicate<T>() { @Override public boolean apply(T t) { return t != null; } })); }
From source file:zotmc.collect.delegate.DisjointUnion.java
public static <E> DisjointUnion<E> of(final Set<E>... backing) { return of(ImmutableList.copyOf(backing)); }
From source file:com.cloudera.exhibit.core.simple.SimpleFrame.java
public static SimpleFrame of(Obs... obs) { return new SimpleFrame(ImmutableList.copyOf(obs)); }
From source file:com.google.template.soy.types.ast.UnionTypeNode.java
public static UnionTypeNode create(Iterable<TypeNode> candidates) { ImmutableList<TypeNode> candidateList = ImmutableList.copyOf(candidates); Preconditions.checkArgument(candidateList.size() > 1); return new AutoValue_UnionTypeNode( candidateList.get(0).sourceLocation().extend(Iterables.getLast(candidateList).sourceLocation()), candidateList);/*w w w. ja v a 2 s .c om*/ }
From source file:com.facebook.presto.operator.RowPagesBuilder.java
public static RowPagesBuilder rowPagesBuilder(TupleInfo... tupleInfos) { return rowPagesBuilder(ImmutableList.copyOf(tupleInfos)); }
From source file:org.immutables.fixture.routine.Routines.java
public static <T> List<T> immutableCopyOf(List<? extends T> list) { return ImmutableList.copyOf(list); }
From source file:io.airlift.drift.server.guice.MethodInvocationFilterBinder.java
static MethodInvocationFilterBinder staticFilterBinder(MethodInvocationFilter... filters) { return staticFilterBinder(ImmutableList.copyOf(filters)); }