Package ca.uhn.fhir.util
Class MultimapCollector<T,K,V>
java.lang.Object
ca.uhn.fhir.util.MultimapCollector<T,K,V>
- All Implemented Interfaces:
Collector<T,
com.google.common.collect.ListMultimap<K, V>, com.google.common.collect.ListMultimap<K, V>>
public class MultimapCollector<T,K,V>
extends Object
implements Collector<T,com.google.common.collect.ListMultimap<K,V>,com.google.common.collect.ListMultimap<K,V>>
Copied from https://stackoverflow.com/questions/23003542/cleanest-way-to-create-a-guava-multimap-from-a-java-8-stream
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBiConsumer
<com.google.common.collect.ListMultimap<K, V>, T> BinaryOperator
<com.google.common.collect.ListMultimap<K, V>> combiner()
finisher()
supplier()
static <T,
K, V> MultimapCollector <T, K, T> toMultimap
(Function<T, K> keyGetter) static <T,
K, V> MultimapCollector <T, K, V> toMultimap
(Function<T, K> keyGetter, Function<T, V> valueGetter)
-
Constructor Details
-
MultimapCollector
-
-
Method Details
-
toMultimap
public static <T,K, MultimapCollector<T,V> K, toMultimapV> (Function<T, K> keyGetter, Function<T, V> valueGetter) -
toMultimap
-
supplier
-
accumulator
- Specified by:
accumulator
in interfaceCollector<T,
K, V>
-
combiner
-
finisher
-
characteristics
- Specified by:
characteristics
in interfaceCollector<T,
K, V>
-