List of usage examples for com.google.common.collect ImmutableList copyOf
public static <E> ImmutableList<E> copyOf(E[] elements)
From source file:ro.cosu.vampires.server.actors.messages.workload.ResponseWorkload.java
public static ResponseWorkload create(List<Workload> configurations) { return new AutoValue_ResponseWorkload(ImmutableList.copyOf(configurations)); }
From source file:com.axemblr.service.cm.models.cm.ConfigList.java
public ConfigList(Config... items) { this(ImmutableList.copyOf(items)); }
From source file:com.mycompany.mavenproject3.Interpreter.java
public static Cons makeList(Sexpression... sexpressions) { ImmutableList<Sexpression> list = ImmutableList.copyOf(sexpressions); return makeListHelp(list); }
From source file:com.google.errorprone.refaster.UNewClass.java
public static UNewClass create(UExpression enclosingExpression, List<? extends UExpression> typeArguments, UExpression identifier, List<UExpression> arguments, @Nullable UClassDecl classBody) { return new AutoValue_UNewClass(enclosingExpression, ImmutableList.copyOf(typeArguments), identifier, ImmutableList.copyOf(arguments), classBody); }
From source file:org.jclouds.azurecompute.arm.domain.VirtualMachineScaleSetNetworkProfile.java
@SerializedNames({ "networkInterfaceConfigurations" }) public static VirtualMachineScaleSetNetworkProfile create( final List<NetworkInterfaceConfiguration> networkInterfaceConfigurations) { return builder().networkInterfaceConfigurations( networkInterfaceConfigurations == null ? ImmutableList.<NetworkInterfaceConfiguration>of() : ImmutableList.copyOf(networkInterfaceConfigurations)) .build();/*from ww w.jav a 2 s.c om*/ }
From source file:com.griddynamics.jagger.invoker.CircularSupplier.java
public static <T> CircularSupplier<T> create(Iterable<T> iterable) { return new CircularSupplier<T>(ImmutableList.copyOf(iterable)); }
From source file:com.opengamma.web.server.push.analytics.AnalyticsColumnGroup.java
AnalyticsColumnGroup(String name, List<AnalyticsColumn> columns) { ArgumentChecker.notNull(name, "name"); ArgumentChecker.notNull(columns, "cols"); _name = name;/*from w w w. j a v a 2s. c o m*/ _columns = ImmutableList.copyOf(columns); }
From source file:org.glowroot.api.internal.ThrowableInfo.java
private static ThrowableInfo from(Throwable t, @Nullable List<StackTraceElement> causedStackTrace) { int framesInCommon = 0; ImmutableList<StackTraceElement> stackTrace = ImmutableList.copyOf(t.getStackTrace()); if (causedStackTrace != null) { ListIterator<StackTraceElement> i = stackTrace.listIterator(stackTrace.size()); ListIterator<StackTraceElement> j = causedStackTrace.listIterator(causedStackTrace.size()); while (i.hasPrevious() && j.hasPrevious()) { StackTraceElement element = i.previous(); StackTraceElement causedElement = j.previous(); if (!element.equals(causedElement)) { break; }/*from w w w . j a va 2 s . c o m*/ framesInCommon++; } if (framesInCommon > 0) { // strip off common frames stackTrace = stackTrace.subList(0, stackTrace.size() - framesInCommon); } } ImmutableThrowableInfo.Builder builder = ImmutableThrowableInfo.builder().display(t.toString()) .addAllStackTrace(stackTrace).framesInCommonWithCaused(framesInCommon); Throwable cause = t.getCause(); if (cause != null) { // pass t's original stack trace to construct the nested cause // (not stackTraces, which now has common frames removed) builder.cause(from(cause, Arrays.asList(t.getStackTrace()))); } return builder.build(); }
From source file:org.jboss.pressgang.ccms.util.WebElementUtil.java
public static List<String> elementsToText(Collection<WebElement> webElements) { return ImmutableList.copyOf(Collections2.transform(webElements, WebElementToTextFunction.FUNCTION)); }
From source file:ro.cosu.vampires.server.actors.messages.configuration.DeleteConfiguration.java
public static DeleteConfiguration create(List<String> configurations, User user) { return new AutoValue_DeleteConfiguration(ImmutableList.copyOf(configurations), user); }