OptionalInt.IfPresent(IIntConsumer) 方法

定义

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

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

参数

action
IIntConsumer

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

属性

注解

Java文档java.util.OptionalInt.ifPresent(java.util.function.IntConsumer)

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

适用于