Additional methods that depend on the presence or absence of a contained value are provided, such as {@link #orElse(double) orElse()}(return a default value if value not present) and {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a blockof code if the value is present).
This is a value-based class; use of identity-sensitive operations (including reference equality ( {@code ==}), identity hash code, or synchronization) on instances of {@code OptionalDouble} may have unpredictable results and should be avoided. @since 1.8
|
|