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:org.glowroot.common.ClassNames.java

public static ImmutableList<String> fromInternalNames(String /*@Nullable*/[] internalNames) {
    if (internalNames == null) {
        return ImmutableList.of();
    }//from   w w  w  .j a  v a 2s .  c  o  m
    List<String> classNames = Lists.newArrayList();
    for (String internalName : internalNames) {
        classNames.add(internalName.replace('/', '.'));
    }
    return ImmutableList.copyOf(classNames);
}

From source file:org.ldp4j.application.sdk.HttpRequestSupport.java

protected static ImmutableHeader createHeader(String header, String value, ImmutableElement... elements) {
    return new ImmutableHeader(header, value, ImmutableList.copyOf(elements));
}

From source file:com.cdancy.etcd.rest.options.CreateUserOptions.java

@SerializedNames({ "user", "password", "roles", "grant", "revoke" })
public static CreateUserOptions create(String user, String password, List<String> roles, List<String> grant,
        List<String> revoke) {
    return new AutoValue_CreateUserOptions(user, password,
            roles != null ? ImmutableList.copyOf(roles) : ImmutableList.<String>of(),
            grant != null ? ImmutableList.copyOf(grant) : ImmutableList.<String>of(),
            revoke != null ? ImmutableList.copyOf(revoke) : ImmutableList.<String>of());
}

From source file:me.lucko.luckperms.commands.Arg.java

public static ImmutableList<Arg> list(Arg... args) {
    return ImmutableList.copyOf(args);
}

From source file:io.crate.sql.tree.QualifiedName.java

public static QualifiedName of(String first, String... rest) {
    Preconditions.checkNotNull(first, "first is null");
    return new QualifiedName(ImmutableList.copyOf(Lists.asList(first, rest)));
}

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

public static UModifiers create(long flagBits, Iterable<? extends UAnnotation> annotations) {
    return new AutoValue_UModifiers(flagBits, ImmutableList.copyOf(annotations));
}

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

/**
 * Creates a MultiPoint from the given points.
 *
 * @param points The {@link Point} sequence.
 * @return MultiPoint/* ww  w  .j a va 2  s  . com*/
 */
public static MultiPoint of(Point... points) {
    return of(ImmutableList.copyOf(points));
}

From source file:com.yahoo.yqlplus.engine.internal.plan.IndexKey.java

private IndexKey(Iterable<String> cols) {
    this.columnOrder = ImmutableList.copyOf(cols);
    List<String> copy = Lists.newArrayList(cols);
    Collections.sort(copy);/*  ww w  .j a va2s . c  om*/
    this.columns = copy;
    lowerCaseColumns = new ArrayList<>(this.columns.size());
    for (String col : this.columns) {
        lowerCaseColumns.add(col.toLowerCase());
    }
    Collections.sort(lowerCaseColumns);
}

From source file:io.v.v23.VLoaderException.java

VLoaderException(List<Throwable> exceptions) {
    super(getMessages(exceptions));
    this.exceptions = ImmutableList.copyOf(exceptions);
}

From source file:org.glowroot.weaving.AdviceMatcherBase.java

static ImmutableList<AdviceMatcher> getAdviceMatchers(String className, List<Advice> advisors) {
    List<AdviceMatcher> adviceMatchers = Lists.newArrayList();
    for (Advice advice : advisors) {
        if (AdviceMatcherBase.isClassNameMatch(className, advice)) {
            adviceMatchers.add(AdviceMatcher.of(advice));
        }/*w ww. j  a va2  s  .com*/
    }
    return ImmutableList.copyOf(adviceMatchers);
}