T
- type of the optionalpublic class OptionalConsumer<T> extends Object
This code has been copied from: https://stackoverflow.com/a/29395324/4815083.
Modifier and Type | Method and Description |
---|---|
OptionalConsumer<T> |
ifNotPresent(Runnable r) |
OptionalConsumer<T> |
ifPresent(java.util.function.Consumer<T> c) |
static <T> OptionalConsumer<T> |
of(Optional<T> optional) |
public static <T> OptionalConsumer<T> of(Optional<T> optional)
public OptionalConsumer<T> ifPresent(java.util.function.Consumer<T> c)
public OptionalConsumer<T> ifNotPresent(Runnable r)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.