Dela via


Collectors.ToUnmodifiableSet Method

Definition

Returns a Collector that accumulates the input elements into an unmodifiable Set.

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

Returns

a Collector that accumulates the input elements into an unmodifiable Set

Attributes

Remarks

Returns a Collector that accumulates the input elements into an unmodifiable Set. The returned Collector disallows null values and will throw NullPointerException if it is presented with a null value. If the input contains duplicate elements, an arbitrary element of the duplicates is preserved.

This is an Collector.Characteristics#UNORDERED unordered Collector.

Added in 10.

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

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