OptionalLong.IfPresent(ILongConsumer) 方法

定义

如果存在值,则使用该值执行给定操作,否则不执行任何操作。

[Android.Runtime.Register("ifPresent", "(Ljava/util/function/LongConsumer;)V", "", ApiSince=24)]
public void IfPresent(Java.Util.Functions.ILongConsumer? action);
[<Android.Runtime.Register("ifPresent", "(Ljava/util/function/LongConsumer;)V", "", ApiSince=24)>]
member this.IfPresent : Java.Util.Functions.ILongConsumer -> unit

参数

action
ILongConsumer

要执行的操作(如果存在值)

属性

注解

Java文档java.util.OptionalLong.ifPresent(java.util.function.LongConsumer)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于