Additional methods that depend on the presence or absence of a contained value are provided, such as {@link #orElse(long) orElse()}(return a default value if value not present) and {@link #ifPresent(java.util.function.LongConsumer) 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 OptionalLong} may have unpredictable results and should be avoided. @since 1.8
|
|