public interface CollectionUtils
| 限定符和类型 | 方法和说明 |
|---|---|
static <INPUT,OUTPUT> |
as(INPUT[] array,
Function<INPUT,OUTPUT> converter) |
static <INPUT,OUTPUT> |
as(Iterable<INPUT> iteration,
Function<INPUT,OUTPUT> converter) |
static <K,V> V |
computeIfAbsent(ConcurrentMap<K,V> map,
K key,
Supplier<V> supplier) |
static <K,V> V |
computeIfAbsent(ConcurrentMap<K,V> map,
K key,
Supplier<V> supplier,
Runnable actionIfAbsent) |
static <V> boolean |
equalsIgnoreOrder(List<V> left,
List<V> right,
Comparator<V> comparator) |
static <T extends Comparable<T>> |
min(T left,
T right) |
static <T> T |
min(T left,
T right,
Comparator<T> comparator) |
static <T> T |
next(T given,
Iterable<T> iteration) |
static <K> void |
putNew(K key,
Function<K,K> putMethod,
Supplier<Object> name)
For the case that key and value are the same object.
|
static <K,V> V |
putNew(K key,
V value,
BiFunction<K,V,V> putMethod,
Supplier<Object> name) |
static <K,V> V |
putNew(K key,
V value,
Map<K,V> map,
Supplier<Object> name) |
static <T> T |
random(Collection<T> elements) |
static <T> T |
random(T given,
Iterable<T> iteration) |
static <K,V> void |
removeExisting(K key,
V value,
Map<K,V> map,
Supplier<Object> name) |
static <K,V> void |
replaceExisting(K key,
V oldValue,
V newValue,
Map<K,V> map,
Supplier<Object> name) |
static <T> T min(T left,
T right,
Comparator<T> comparator)
static <T extends Comparable<T>> T min(T left, T right)
static <T> T next(T given,
Iterable<T> iteration)
static <T> T random(T given,
Iterable<T> iteration)
static <T> T random(Collection<T> elements)
static <INPUT,OUTPUT> Iterable<OUTPUT> as(Iterable<INPUT> iteration, Function<INPUT,OUTPUT> converter)
static <K> void putNew(K key,
Function<K,K> putMethod,
Supplier<Object> name)
static <K,V> V putNew(K key,
V value,
BiFunction<K,V,V> putMethod,
Supplier<Object> name)
static <K,V> void replaceExisting(K key,
V oldValue,
V newValue,
Map<K,V> map,
Supplier<Object> name)
static <K,V> void removeExisting(K key,
V value,
Map<K,V> map,
Supplier<Object> name)
static <K,V> V computeIfAbsent(ConcurrentMap<K,V> map, K key, Supplier<V> supplier, Runnable actionIfAbsent)
static <K,V> V computeIfAbsent(ConcurrentMap<K,V> map, K key, Supplier<V> supplier)
static <V> boolean equalsIgnoreOrder(List<V> left, List<V> right, Comparator<V> comparator)
Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.