Collectors.PartitioningBy Method

Definition

Overloads

PartitioningBy(IPredicate, ICollector)

Returns a Collector which partitions the input elements according to a Predicate, reduces the values in each partition according to another Collector, and organizes them into a Map<Boolean, D> whose values are the result of the downstream reduction.

PartitioningBy(IPredicate)

Returns a Collector which partitions the input elements according to a Predicate, and organizes them into a Map<Boolean, List<T>>.

PartitioningBy(IPredicate, ICollector)

Returns a Collector which partitions the input elements according to a Predicate, reduces the values in each partition according to another Collector, and organizes them into a Map<Boolean, D> whose values are the result of the downstream reduction.

[Android.Runtime.Register("partitioningBy", "(Ljava/util/function/Predicate;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "D", "A" })]
public static Java.Util.Streams.ICollector? PartitioningBy (Java.Util.Functions.IPredicate? predicate, Java.Util.Streams.ICollector? downstream);
[<Android.Runtime.Register("partitioningBy", "(Ljava/util/function/Predicate;Ljava/util/stream/Collector;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "D", "A" })>]
static member PartitioningBy : Java.Util.Functions.IPredicate * Java.Util.Streams.ICollector -> Java.Util.Streams.ICollector

Parameters

predicate
IPredicate

a predicate used for classifying input elements

downstream
ICollector

a Collector implementing the downstream reduction

Returns

a Collector implementing the cascaded partitioning operation

Attributes

Remarks

Returns a Collector which partitions the input elements according to a Predicate, reduces the values in each partition according to another Collector, and organizes them into a Map<Boolean, D> whose values are the result of the downstream reduction.

The returned Map always contains mappings for both false and true keys. There are no guarantees on the type, mutability, serializability, or thread-safety of the Map returned.

Java documentation for java.util.stream.Collectors.partitioningBy(java.util.function.Predicate<? super T>, java.util.stream.Collector<? super T, A, D>).

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

PartitioningBy(IPredicate)

Returns a Collector which partitions the input elements according to a Predicate, and organizes them into a Map<Boolean, List<T>>.

[Android.Runtime.Register("partitioningBy", "(Ljava/util/function/Predicate;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Streams.ICollector? PartitioningBy (Java.Util.Functions.IPredicate? predicate);
[<Android.Runtime.Register("partitioningBy", "(Ljava/util/function/Predicate;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member PartitioningBy : Java.Util.Functions.IPredicate -> Java.Util.Streams.ICollector

Parameters

predicate
IPredicate

a predicate used for classifying input elements

Returns

a Collector implementing the partitioning operation

Attributes

Remarks

Returns a Collector which partitions the input elements according to a Predicate, and organizes them into a Map<Boolean, List<T>>.

The returned Map always contains mappings for both false and true keys. There are no guarantees on the type, mutability, serializability, or thread-safety of the Map or List returned.

Java documentation for java.util.stream.Collectors.partitioningBy(java.util.function.Predicate<? super T>).

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