Optional.Filter(IPredicate) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
If a value is present, and the value matches the given predicate,
returns an Optional
describing the value, otherwise returns an
empty Optional
.
[Android.Runtime.Register("filter", "(Ljava/util/function/Predicate;)Ljava/util/Optional;", "", ApiSince=24)]
public Java.Util.Optional? Filter (Java.Util.Functions.IPredicate? predicate);
[<Android.Runtime.Register("filter", "(Ljava/util/function/Predicate;)Ljava/util/Optional;", "", ApiSince=24)>]
member this.Filter : Java.Util.Functions.IPredicate -> Java.Util.Optional
Parameters
- predicate
- IPredicate
the predicate to apply to a value, if present
Returns
an Optional
describing the value of this
Optional
, if a value is present and the value matches the
given predicate, otherwise an empty Optional
- Attributes
Remarks
If a value is present, and the value matches the given predicate, returns an Optional
describing the value, otherwise returns an empty Optional
.
Java documentation for java.util.Optional.filter(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.