Optional.Map(IFunction) 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, returns an Optional
describing (as if by
#ofNullable
) the result of applying the given mapping function to
the value, otherwise returns an empty Optional
.
[Android.Runtime.Register("map", "(Ljava/util/function/Function;)Ljava/util/Optional;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "U" })]
public Java.Util.Optional? Map (Java.Util.Functions.IFunction? mapper);
[<Android.Runtime.Register("map", "(Ljava/util/function/Function;)Ljava/util/Optional;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "U" })>]
member this.Map : Java.Util.Functions.IFunction -> Java.Util.Optional
Parameters
- mapper
- IFunction
the mapping function to apply to a value, if present
Returns
an Optional
describing the result of applying a mapping
function to the value of this Optional
, if a value is
present, otherwise an empty Optional
- Attributes
Remarks
If a value is present, returns an Optional
describing (as if by #ofNullable
) the result of applying the given mapping function to the value, otherwise returns an empty Optional
.
If the mapping function returns a null
result then this method returns an empty Optional
.
Java documentation for java.util.Optional.map(java.util.function.Function<? super T, ? extends U>)
.
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.