Package org.mapfish.print
Class OptionalUtils
- java.lang.Object
-
- org.mapfish.print.OptionalUtils
-
public final class OptionalUtils extends java.lang.Object
Utilities for Java's Optional class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Optional<T>
or(java.util.function.Supplier<java.util.Optional<? extends T>>... optionals)
Return the first optional to be defined.static <T> java.util.Optional<T>
or(java.util.Optional<T> a, java.util.Optional<? extends T> b)
Return the first optional to be defined.
-
-
-
Method Detail
-
or
public static <T> java.util.Optional<T> or(java.util.Optional<T> a, java.util.Optional<? extends T> b)
Return the first optional to be defined.- Type Parameters:
T
- The type- Parameters:
a
- The firstb
- The second- Returns:
- a or b or empty
-
or
@SafeVarargs public static <T> java.util.Optional<T> or(java.util.function.Supplier<java.util.Optional<? extends T>>... optionals)
Return the first optional to be defined.- Type Parameters:
T
- The type- Parameters:
optionals
- the lambdas returning the optionals- Returns:
- the first non-empty or empty
-
-