Constructor and Description |
---|
VaultCollectors() |
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,?,List<T>> |
toList()
Returns a
Collector that accumulates the input elements into a
new List . |
static <T,K,U> Collector<T,?,Map<K,U>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper)
Returns a
Collector that accumulates elements into a
Map whose keys and values are the result of applying the provided
mapping functions to the input elements. |
static <T,K,U> Collector<T,?,Map<K,U>> |
toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends U> valueMapper,
BinaryOperator<U> mergeFunction)
Returns a
Collector that accumulates elements into a
Map whose keys and values are the result of applying the provided
mapping functions to the input elements. |
static <T> Collector<T,?,Set<T>> |
toSet()
Returns a
Collector that accumulates the input elements into a
new Set . |
public static <T> Collector<T,?,List<T>> toList()
Collector
that accumulates the input elements into a
new List
.T
- the type of the input elementsCollector
which collects all the input elements into a
List
, in encounter orderpublic static <T> Collector<T,?,Set<T>> toSet()
Collector
that accumulates the input elements into a
new Set
.T
- the type of the input elementsCollector
which collects all the input elements into a
Set
public static <T,K,U> Collector<T,?,Map<K,U>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
Collector
that accumulates elements into a
Map
whose keys and values are the result of applying the provided
mapping functions to the input elements.
If the mapped keys contains duplicates (according to
Object.equals(Object)
), an IllegalStateException
is
thrown when the collection operation is performed.
T
- type of the input elementsK
- output type of the key mapping functionU
- output type of the value mapping functionkeyMapper
- mapping function to produce keysvalueMapper
- mapping function to produce valuesCollector
which collects elements into a Map
whose keys and values are the result of applying mapping functions to
the input elementspublic static <T,K,U> Collector<T,?,Map<K,U>> toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
Collector
that accumulates elements into a
Map
whose keys and values are the result of applying the provided
mapping functions to the input elements.
If the mapped
keys contains duplicates (according to Object.equals(Object)
),
the value mapping function is applied to each equal element, and the
results are merged using the provided merging function.
T
- type of the input elementsK
- output type of the key mapping functionU
- output type of the value mapping functionkeyMapper
- mapping function to produce keysvalueMapper
- mapping function to produce valuesmergeFunction
- merge function, used to resolve collisions between
values associated with the same key, as supplied
to Map.merge(Object, Object, BiFunction)
Collector
which collects elements into a Map
whose keys are the result of applying a key mapping function to the input
elements, and whose values are the result of applying a value mapping
function to all input elements equal to the key and combining them
using the merge functionCopyright © Veeva Systems 2017–2021. All rights reserved.