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.cdancy.artifactory.rest.domain.search.AQLResult.java

@SerializedNames({ "results", "range" })
public static AQLResult create(List<Result> results, Range range) {
    return new AutoValue_AQLResult(results != null ? ImmutableList.copyOf(results) : ImmutableList.<Result>of(),
            range);// ww w.  j a v  a  2 s  .c  o m
}

From source file:org.jclouds.docker.internal.NullSafeCopies.java

public static <E> List<E> copyOf(@Nullable List<E> list) {
    return list != null ? ImmutableList.copyOf(list) : ImmutableList.<E>of();
}

From source file:com.google.errorprone.refaster.UIntersectionClassType.java

static UIntersectionClassType create(Iterable<? extends UType> bounds) {
    return new AutoValue_UIntersectionClassType(ImmutableList.copyOf(bounds));
}

From source file:org.eclipse.buildship.core.util.collections.CollectionsUtils.java

/**
 * Splits the given string for each space that is found.
 *
 * @param string the string to split, can be null
 * @return the split string with each segment being an element of the returned list, never null
 *///from  w w  w .ja va  2 s.  c  om
public static ImmutableList<String> splitBySpace(String string) {
    return Strings.isNullOrEmpty(string) ? ImmutableList.<String>of()
            : ImmutableList.copyOf(Splitter.on(SPACE).omitEmptyStrings().splitToList(string));
}

From source file:com.google.errorprone.refaster.UIntersectionType.java

@VisibleForTesting
static UIntersectionType create(UExpression... bounds) {
    return create(ImmutableList.copyOf(bounds));
}

From source file:com.google.devtools.build.skyframe.CompoundEvaluationProgressReceiver.java

public static EvaluationProgressReceiver of(EvaluationProgressReceiver... receivers) {
    return new CompoundEvaluationProgressReceiver(ImmutableList.copyOf(receivers));
}

From source file:com.google.errorprone.refaster.UClassType.java

public static UClassType create(CharSequence fullyQualifiedClass, List<UType> typeArguments) {
    return new AutoValue_UClassType(StringName.of(fullyQualifiedClass), ImmutableList.copyOf(typeArguments));
}

From source file:com.google.errorprone.matchers.method.MatchState.java

static MatchState create(Type ownerType, MethodSymbol methodSymbol) {
    return new AutoValue_MatchState(ownerType, methodSymbol,
            ImmutableList.copyOf(methodSymbol.type.getParameterTypes()));
}

From source file:com.google.errorprone.refaster.UAnyOf.java

public static UAnyOf create(Iterable<? extends UExpression> expressions) {
    return new AutoValue_UAnyOf(ImmutableList.copyOf(expressions));
}

From source file:com.cdancy.artifactory.rest.domain.error.RequestStatus.java

@SerializedNames({ "messages", "errors" })
public static RequestStatus create(List<Message> messages, List<Error> errors) {
    return new AutoValue_RequestStatus(
            messages != null ? ImmutableList.copyOf(messages) : ImmutableList.<Message>of(),
            errors != null ? ImmutableList.copyOf(errors) : ImmutableList.<Error>of());
}