Package io.karma.kommons.collection
Class CollectionUtils
java.lang.Object
io.karma.kommons.collection.CollectionUtils
- Since:
- 02/02/2022
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List
<T> asList
(Collection<T> collection) static <T,
C extends Collection<T>>
CcollectFutures
(Collection<? extends Future<? extends T>> futures, Supplier<? extends C> factory) static <T,
C extends Collection<T>>
CflatMapFutures
(Collection<? extends Future<? extends Collection<? extends T>>> futures, Supplier<? extends C> factory) static <T,
C extends Collection<T>>
CfromIterable
(Iterable<? extends T> iterable, Supplier<? extends C> factory) static <T,
C extends Collection<T>>
CfromIterator
(Iterator<? extends T> iterator, Supplier<? extends C> factory) static <K,
V, M extends Map<V, K>>
MreverseMap
(@Nullable Map<? extends K, ? extends V> map) static <K,
V, M extends Map<V, K>>
MreverseMap
(@Nullable Map<? extends K, ? extends V> map, @Nullable Supplier<? extends Map<? extends V, ? extends K>> factory)
-
Method Details
-
asList
-
fromIterator
public static <T,C extends Collection<T>> C fromIterator(Iterator<? extends T> iterator, Supplier<? extends C> factory) -
fromIterable
public static <T,C extends Collection<T>> C fromIterable(Iterable<? extends T> iterable, Supplier<? extends C> factory) -
collectFutures
public static <T,C extends Collection<T>> C collectFutures(Collection<? extends Future<? extends T>> futures, Supplier<? extends C> factory) -
flatMapFutures
public static <T,C extends Collection<T>> C flatMapFutures(Collection<? extends Future<? extends Collection<? extends T>>> futures, Supplier<? extends C> factory) -
reverseMap
-
reverseMap
-