net.dongliu.commons.lang.Lists Maven / Gradle / Ivy
package net.dongliu.commons.lang;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* utils method for list
*
* @author Dong Liu
*/
public class Lists {
/**
* get list
*/
public static List of(T... t) {
return (List) Arrays.asList(t);
}
/**
* get immutable list
*/
@SuppressWarnings("all")
public static List immutableOf(T... t) {
return Collections.unmodifiableList(Arrays.asList(t));
}
}