Package io.github.pellse.util.collection
Interface CollectionUtils
public interface CollectionUtils
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <E> Collection<E> asCollection(Iterable<E> iterable) concat(C collection1, C collection2) static <E> Set<E> static <K,V> Map <K, V> static booleanstatic booleanstatic booleanisNotEmpty(Iterable<?> iterable) static booleanisNotEmpty(Map<?, ?> map) static <K,V> Map <K, V> static <K,V, VC extends Collection<V>, ID>
Map<K, VC> mergeMaps(Map<K, VC> existingMap, Map<K, VC> newMap, Function<? super V, ID> idResolver, Function<Collection<V>, VC> collectionConverter) static <K,V> Map <K, V> static <K,V> Map <K, V> static <K,V, M extends Map<K, V>>
Mstatic <K,V> Map <K, V> nullToEmptyMap(Map<K, V> value) static <K,V, T extends Map<K, V>>
TnullToEmptyMap(T value, Supplier<T> defaultFactory) static <K,V, V1> Map <K, V1> readAll(Iterable<? extends K> keys, Map<K, V> sourceMap, Supplier<M> mapSupplier, Function<V, V1> mappingFunction) static <K,V> Map <K, V> static <K,V, VC extends Collection<V>>
VCremoveDuplicates(Collection<V> coll, Function<? super V, K> keyExtractor, Function<Collection<V>, VC> collectionConverter) static intsubtractFromMap(Map<K, List<V>> mapToSubtract, Map<K, List<V>> srcMap, Function<? super V, ID> idResolver) static <K,V, VC extends Collection<V>, ID>
Map<K, VC> subtractFromMap(Map<K, VC> mapToSubtract, Map<K, VC> srcMap, Function<? super V, ID> idResolver, Supplier<VC> collectionFactory) static <T,K, V> HashMap <K, V> toHashMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor, Function<? super T, ? extends V> valueExtractor) static <T,K, V, M extends Map<K, V>>
MtoJavaMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor, Function<? super T, ? extends V> valueExtractor, IntFunction<M> mapFactory) static <T,K> LinkedHashMap <K, T> toLinkedHashMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor) static <T,K, V> LinkedHashMap <K, V> toLinkedHashMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor, Function<? super T, ? extends V> valueExtractor) static <K,V> LinkedHashMap <K, V> toLinkedHashMap(Map<K, V> map) toStream(C iterable) static <T,R> List <R> static <K,V, K1, V1>
Map<K1, V1> transformMap(Map<K, V> map, BiFunction<K, V, K1> keyMapper, BiFunction<K, V, V1> valueMapper) static <K,K1, V> Map <K1, V> transformMapKeys(Map<K, V> map, BiFunction<K, V, K1> keyMapper) static <K,K1, V> Map <K1, V> transformMapKeys(Map<K, V> map, Function<K, K1> keyMapper) static <K,V, V1> Map <K, V1> transformMapValues(Map<K, V> map, BiFunction<K, V, V1> valueMapper) static <K,V, V1> Map <K, V1> transformMapValues(Map<K, V> map, Function<V, V1> valueMapper) static <E,C extends Collection<E>>
C
-
Method Details
-
toStream
-
concat
-
isEmpty
-
isNotEmpty
-
isEmpty
-
isNotEmpty
-
nullToEmptyMap
-
nullToEmptyMap
-
transform
-
asCollection
-
translate
static <E,C extends Collection<E>> C translate(Iterable<? extends E> from, Supplier<C> collectionFactory) -
size
-
transformMapKeys
-
transformMapKeys
-
transformMapValues
-
transformMapValues
-
transformMap
static <K,V, Map<K1,K1, V1> V1> transformMap(Map<K, V> map, BiFunction<K, V, K1> keyMapper, BiFunction<K, V, V1> valueMapper) -
newMap
-
newMap
-
newMap
-
diff
-
diff
-
readAll
-
readAll
-
readAll
-
removeDuplicates
static <K,V, VC removeDuplicatesVC extends Collection<V>> (Collection<V> coll, Function<? super V, K> keyExtractor, Function<Collection<V>, VC> collectionConverter) -
toLinkedHashMap
-
toLinkedHashMap
static <T,K> LinkedHashMap<K,T> toLinkedHashMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor) -
toLinkedHashMap
static <T,K, LinkedHashMap<K,V> V> toLinkedHashMap(Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor, Function<? super T, ? extends V> valueExtractor) -
toHashMap
-
toJavaMap
static <T,K, M toJavaMapV, M extends Map<K, V>> (Iterable<T> iterable, Function<? super T, ? extends K> keyExtractor, Function<? super T, ? extends V> valueExtractor, IntFunction<M> mapFactory) -
mergeMaps
-
mergeMaps
static <K,V, Map<K,VC extends Collection<V>, ID> VC> mergeMaps(Map<K, VC> existingMap, Map<K, VC> newMap, Function<? super V, ID> idResolver, Function<Collection<V>, VC> collectionConverter) -
mergeMaps
-
subtractFromMap
-
subtractFromMap
-