Udostępnij za pośrednictwem


Optional.Or(ISupplier) Method

Definition

If a value is present, returns an Optional describing the value, otherwise returns an Optional produced by the supplying function.

[Android.Runtime.Register("or", "(Ljava/util/function/Supplier;)Ljava/util/Optional;", "", ApiSince=33)]
public Java.Util.Optional? Or (Java.Util.Functions.ISupplier? supplier);
[<Android.Runtime.Register("or", "(Ljava/util/function/Supplier;)Ljava/util/Optional;", "", ApiSince=33)>]
member this.Or : Java.Util.Functions.ISupplier -> Java.Util.Optional

Parameters

supplier
ISupplier

the supplying function that produces an Optional to be returned

Returns

returns an Optional describing the value of this Optional, if a value is present, otherwise an Optional produced by the supplying function.

Attributes

Remarks

If a value is present, returns an Optional describing the value, otherwise returns an Optional produced by the supplying function.

Added in 9.

Java documentation for java.util.Optional.or(java.util.function.Supplier<? extends java.util.Optional<? extends 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