OptionalLong

Class OptionalLong

public final class OptionalLong
extends Object

A container object which may or may not contain a long value. If a value is present, isPresent() will return true and getAsLong() will return the value.

Additional methods that depend on the presence or absence of a contained value are provided, such as orElse() (return a default value if value not present) and ifPresent() (execute a block of code if the value is present).

This is a value-based class; use