程序包 cn.godmao.utils
类 CollectUtil
java.lang.Object
cn.hutool.core.collection.CollUtil
cn.godmao.utils.CollectUtil
public class CollectUtil
extends cn.hutool.core.collection.CollUtil
-
嵌套类概要
-
方法概要
修饰符和类型方法说明static <T,V> List<T> distinct(Collection<? extends T> collection, Function<T, V> function) 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> getArr(List<T> collection, Function<T, V> function, Collection<V> values) 获取数组中指定字段满足条件的所有值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<T> getSet(Collection<? extends T> collection, Function<T, V> function, Collection<V> values) 获取数组中指定字段满足条件的所有值static <T,V> Set<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 <T,V> void remove(Collection<? extends T> collection, Function<T, V> function, Collection<V> values) static <T,V> void remove(Collection<? extends T> collection, Function<T, V> function, V... values) static <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从类继承的方法 cn.hutool.core.collection.CollUtil
addAll, addAll, addAll, addAll, addAll, addAll, addAllIfNotContains, addIfAbsent, allMatch, anyMatch, asEnumeration, asIterable, asIterator, clear, contains, contains, containsAll, containsAny, count, countMap, create, create, defaultIfEmpty, defaultIfEmpty, disjunction, distinct, distinct, edit, empty, emptyIfNull, emptyIfNull, extract, extract, fieldValueAsMap, fieldValueMap, filter, filterNew, findOne, findOneByField, forEach, forEach, forEach, forEach, get, getAny, getElementType, getElementType, getFieldValues, getFieldValues, getFieldValues, getFirst, getFirst, getLast, group, groupByField, hasNull, indexOf, indexOfAll, intersection, intersection, intersectionDistinct, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEqualList, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, join, join, join, join, keySet, lastIndexOf, list, list, list, list, list, list, map, max, min, newArrayList, newArrayList, newArrayList, newArrayList, newArrayList, newBlockingQueue, newCopyOnWriteArrayList, newHashSet, newHashSet, newHashSet, newHashSet, newHashSet, newLinkedHashSet, newLinkedList, padLeft, padRight, page, popPart, popPart, removeAny, removeBlank, removeEmpty, removeNull, removeWithAddIf, removeWithAddIf, reverse, reverseNew, safeContains, set, setOrAppend, setValueByMap, size, sort, sort, sort, sortByEntry, sortByPinyin, sortByPinyin, sortByProperty, sortByProperty, sortEntryToList, sortPageAll, sortToMap, split, splitList, sub, sub, sub, sub, subtract, subtractToList, toCollection, toList, toListMap, toMap, toMap, toMap, toMap, toMapList, toTreeSet, trans, union, union, unionAll, unionDistinct, unmodifiable, values, valuesOfKeys, valuesOfKeys, valuesOfKeys, zip, zip, zip
-
方法详细资料
-
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
public static <T,V> List<T> getArr(List<T> collection, Function<T, V> function, Collection<V> values) 获取数组中指定字段满足条件的所有值- 参数:
collection- 数组function- 字段values- 所有值 所有条件
-
getArr
获取数组中指定字段的集合- 参数:
collection- 数组function- 指定字段- 返回:
- IFunction
-
getSet
获取数组中指定字段的集合- 参数:
collection- 数组function- 指定字段- 返回:
- IFunction
-
getSet
public static <T,V> Set<T> getSet(Collection<? extends T> collection, Function<T, V> function, V... values) 获取数组中指定字段满足条件的所有值- 参数:
collection- 数组function- 字段values- 所有值 所有条件
-
getSet
public static <T,V> Set<T> getSet(Collection<? extends T> collection, Function<T, V> function, Collection<V> values) 获取数组中指定字段满足条件的所有值- 参数:
collection- 数组function- 字段values- 所有值 所有条件
-
remove
public static <T,V> void remove(Collection<? extends T> collection, Function<T, V> function, V... values) -
remove
public static <T,V> void remove(Collection<? extends T> collection, Function<T, V> function, Collection<V> 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
-
distinct
-
next
-
next
-
random
-