Collectors.ToSet Method

Definition

Returns a Collector that accumulates the input elements into a new Set.

[Android.Runtime.Register("toSet", "()Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Streams.ICollector? ToSet ();
[<Android.Runtime.Register("toSet", "()Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member ToSet : unit -> Java.Util.Streams.ICollector

Returns

a Collector which collects all the input elements into a Set

Attributes

Remarks

Returns a Collector that accumulates the input elements into a new Set. There are no guarantees on the type, mutability, serializability, or thread-safety of the Set returned; if more control over the returned Set is required, use #toCollection(Supplier).

This is an Collector.Characteristics#UNORDERED unordered Collector.

Java documentation for java.util.stream.Collectors.toSet().

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