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 |
---|---|
<E extends Exception> |
ifNotPresent(ThrowingRunnable<E> 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 <E extends Exception> OptionalConsumer<T> ifNotPresent(ThrowingRunnable<E> r) throws E extends Exception
E extends Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.