Dela via


Collectors.Mapping(IFunction, ICollector) Method

Definition

Adapts a Collector accepting elements of type U to one accepting elements of type T by applying a mapping function to each input element before accumulation.

[Android.Runtime.Register("mapping", "(Ljava/util/function/Function;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "U", "A", "R" })]
public static Java.Util.Streams.ICollector? Mapping (Java.Util.Functions.IFunction? mapper, Java.Util.Streams.ICollector? downstream);
[<Android.Runtime.Register("mapping", "(Ljava/util/function/Function;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "U", "A", "R" })>]
static member Mapping : Java.Util.Functions.IFunction * Java.Util.Streams.ICollector -> Java.Util.Streams.ICollector

Parameters

mapper
IFunction

a function to be applied to the input elements

downstream
ICollector

a collector which will accept mapped values

Returns

a collector which applies the mapping function to the input elements and provides the mapped results to the downstream collector

Attributes

Remarks

Adapts a Collector accepting elements of type U to one accepting elements of type T by applying a mapping function to each input element before accumulation.

Java documentation for java.util.stream.Collectors.mapping(java.util.function.Function<? super T, ? extends U>, java.util.stream.Collector<? super U, A, R>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to