All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.commons.lang.collection.Lists Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package net.dongliu.commons.lang.collection;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * utils method for list
 *
 * @author Dong Liu
 */
public class Lists {

    /**
     * get a list backend by Array.
     * 

* {@code List list = Lists.of("test", "test2");} *

*/ @SafeVarargs public static List of(T... values) { return Arrays.asList(values); } /** * get immutable list */ @SafeVarargs public static List immutable(T... values) { return Collections.unmodifiableList(of(values)); } /** * get immutable list */ public static List immutable(List list) { return Collections.unmodifiableList(list); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy