T - Data type of element stored in this Visitablepublic interface Visitable<T>
| Modifier and Type | Method and Description |
|---|---|
<R> R |
visit(java.util.function.Function<? super T,? extends R> present,
java.util.function.Supplier<? extends R> absent)
The provided function is executed with the value stored in this Visitable if one is present,
otherwise the provided Supplier is executed instead.
|
<R> R visit(java.util.function.Function<? super T,? extends R> present, java.util.function.Supplier<? extends R> absent)
present - Function to execute if this Visitable has a valueabsent - Supplier to execute if this Visitable does not have a Value