程序包 cn.godmao.utils
类 CollectUtil
java.lang.Object
cn.godmao.utils.CollectUtil
-
方法概要
修饰符和类型方法说明static <C extends Collection<E>,E>
Cfill(C array, E obj) static <C extends Collection<E>,E>
Cstatic <T,V> List<V> getArr(Collection<? extends T> collection, Function<T, V> function) 获取数组中指定字段的集合static <T,V> List<T> 获取数组中指定字段满足条件的所有值static <T,V> T getOne(Collection<? extends T> collection, Function<T, V> function, V value) 获取数组中指定字段满足条件的第一个值static <T,V> Set<V> getSet(Collection<? extends T> collection, Function<T, V> function) 获取数组中指定字段的集合static <T,V> Set<? extends T> getSet(Collection<? extends T> collection, Function<T, V> function, V... values) 获取数组中指定字段满足条件的所有值static <K,V> Collection<V> getValues(Map<K, V> map, Collection<? extends K> keys) static <S> List<S>listOf(S... es) static <T,V extends Comparable<? super V>>
Tmax(Collection<? extends T> collection, Function<T, V> function) static <T,V extends Comparable<? super V>>
Tmin(Collection<? extends T> collection, Function<T, V> function) static <T> Tstatic <T> Tnext(List<T> array, AtomicLong counter) static <T> Tstatic <S> Set<S>setOf(S... es) toGroup(Collection<V> collection, Function<V, K> function) 集合分组toMap(Collection<T> collection) 集合 转 Map K 是 hashCodestatic <K,V> Map<K, V> toMap(Collection<V> collection, Function<V, K> function) 集合 转 Map K 是 Functionstatic <K1,K2, V> Map<K1, K2> toMap(Collection<V> collection, Function<V, K1> f1, Function<V, K2> f2) 集合 转 Map K 是 Functionstatic <K,V> Map<K, V> 集合 转 Map K 是 Function
-
方法详细资料
-
toMap
集合 转 Map K 是 hashCode -
toMap
集合 转 Map K 是 Function -
toMap
public static <K1,K2, Map<K1,V> K2> toMap(Collection<V> collection, Function<V, K1> f1, Function<V, K2> f2) 集合 转 Map K 是 Function -
toMap
集合 转 Map K 是 Function -
toGroup
集合分组 -
getOne
获取数组中指定字段满足条件的第一个值- 参数:
collection- 数组function- 字段value- 值 条件
-
getArr
获取数组中指定字段满足条件的所有值- 参数:
collection- 数组function- 字段values- 所有值 所有条件
-
getArr
获取数组中指定字段的集合- 参数:
collection- 数组function- 指定字段- 返回:
- IFunction
-
getSet
获取数组中指定字段的集合- 参数:
collection- 数组function- 指定字段- 返回:
- IFunction
-
getSet
public static <T,V> Set<? extends T> getSet(Collection<? extends T> collection, Function<T, V> function, V... values) 获取数组中指定字段满足条件的所有值- 参数:
collection- 数组function- 字段values- 所有值 所有条件
-
getValues
-
setOf
-
listOf
-
max
public static <T,V extends Comparable<? super V>> T max(Collection<? extends T> collection, Function<T, V> function) -
min
public static <T,V extends Comparable<? super V>> T min(Collection<? extends T> collection, Function<T, V> function) -
fill
-
fill
-
next
-
next
-
random
-