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.jclouds.docker.internal.NullSafeCopies.java

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

From source file:org.jclouds.azurecompute.arm.domain.VirtualMachineScaleSetDNSSettings.java

@SerializedNames({ "dnsServers" })
public static VirtualMachineScaleSetDNSSettings create(final List<String> dnsServers) {

    return new AutoValue_VirtualMachineScaleSetDNSSettings(
            dnsServers == null ? ImmutableList.<String>of() : ImmutableList.copyOf(dnsServers));
}

From source file:org.jclouds.b2.domain.B2ObjectList.java

@SerializedNames({ "files", "nextFileId", "nextFileName" })
public static B2ObjectList create(List<Entry> files, @Nullable String nextFileId,
        @Nullable String nextFileName) {
    return new AutoValue_B2ObjectList(ImmutableList.copyOf(files), nextFileId, nextFileName);
}

From source file:cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer.java

private static List<String> getForcedPrefixes() {
    if (forcedPrefixes == null) {
        String prefixList = System.getProperty("fml.forcedDeobfuscationPrefixes");
        if (prefixList != null && FMLDeobfuscatingRemapper.INSTANCE.isDeobfuscationDataLoaded()) {
            forcedPrefixes = ImmutableList.copyOf(Splitter.on(';').split(prefixList));
            FMLRelaunchLog.fine("Prefixes selected for deobfuscation: " + prefixList);
        } else {/*w  ww. jav a2 s .c  o m*/
            forcedPrefixes = ImmutableList.of();
        }
    }

    return forcedPrefixes;
}

From source file:com.google.template.soy.jssrc.dsl.Statement.java

/** Creates a new code chunk representing the concatenation of the given statements. */
public static Statement of(Iterable<Statement> stmts) {
    ImmutableList<Statement> copy = ImmutableList.copyOf(stmts);
    return copy.size() == 1 ? copy.get(0) : StatementList.create(copy);
}

From source file:com.opengamma.strata.basics.CalculationTargetList.java

/**
 * Obtains an instance from a list of targets.
 * /*from   w ww .j  a  v a  2 s.co  m*/
 * @param targets  the list of targets
 * @return the list of targets
 */
public static CalculationTargetList of(CalculationTarget... targets) {
    return new CalculationTargetList(ImmutableList.copyOf(targets));
}

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

static UIntersectionType create(Iterable<? extends UExpression> bounds) {
    return new AutoValue_UIntersectionType(ImmutableList.copyOf(bounds));
}

From source file:de.metas.ui.web.document.filter.DocumentFiltersList.java

public static DocumentFiltersList ofFilters(final List<DocumentFilter> filters) {
    if (filters == null || filters.isEmpty()) {
        return EMPTY;
    }/*from w w w  .j  a v a  2  s  .  c  o m*/

    final ImmutableList<JSONDocumentFilter> jsonFiltersEffective = null;
    final ImmutableList<DocumentFilter> filtersEffective = ImmutableList.copyOf(filters);
    return new DocumentFiltersList(jsonFiltersEffective, filtersEffective);
}

From source file:org.jclouds.b2.domain.ListUnfinishedLargeFilesResponse.java

@SerializedNames({ "nextFileId", "files" })
public static ListUnfinishedLargeFilesResponse create(@Nullable String nextFileId, List<Entry> files) {
    return new AutoValue_ListUnfinishedLargeFilesResponse(nextFileId, ImmutableList.copyOf(files));
}

From source file:com.palantir.typescript.Builders.java

/**
 * Forces a full clean/rebuild of all the workspace project that have the TypeScript nature.
 *//*from  w w  w . j  a v a2  s .c  om*/
public static void rebuildWorkspace() {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();

    rebuildProjects(ImmutableList.copyOf(workspace.getRoot().getProjects()));
}