public class ColUtils extends Object
| Constructor and Description |
|---|
ColUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E> Collection<E> |
toCol(E e)
将单个对象转化为集合
|
static <E,C extends Collection<E>> |
toCol(E t,
Supplier<C> supplier)
将单个对象转化为集合
|
static <E> E |
toObj(Collection<E> collection)
取出集合中第一个元素
|
public static <E> Collection<E> toCol(E e)
E - 对象类型e - 对象实例public static <E,C extends Collection<E>> Collection<E> toCol(E t, Supplier<C> supplier)
E - 对象类型C - 集合类型t - 对象实例supplier - 集合工厂public static <E> E toObj(Collection<E> collection)
E - 集合中元素类型collection - 集合实例Copyright © 2021. All rights reserved.