• Method Summary

    empty()

    Returns an empty OptionalDouble instance.

    boolean

    Indicates whether some other object is "equal to" this OptionalDouble.

    double

    If a value is present, returns the value, otherwise throws NoSuchElementException.

    int

    hashCode()

    Returns the hash code of the value, if present, otherwise 0 (zero) if no value is present.

    void

    If a value is present, performs the given action with the value, otherwise does nothing.

    void

    If a value is present, performs the given action with the value, otherwise performs the given empty-based action.

    boolean

    isEmpty()

    If a value is not present, returns true, otherwise false.

    boolean

    isPresent()

    If a value is present, returns true, otherwise false.

    of(double value)

    Returns an OptionalDouble describing the given value.

    double

    orElse(double other)

    If a value is present, returns the value, otherwise returns other.

    double

    If a value is present, returns the value, otherwise returns the result produced by the supplying function.

    double

    If a value is present, returns the value, otherwise throws NoSuchElementException.

    orElseThrow(Supplier<? extends X> exceptionSupplier)

    If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.

    stream()

    If a value is present, returns a sequential DoubleStream containing only that value, otherwise returns an empty DoubleStream.

    toString()

    Returns a non-empty string representation of this OptionalDouble suitable for debugging.

  • Method Details

    • empty

    • of

    • getAsDouble

    • isPresent

    • isEmpty

    • ifPresent

    • ifPresentOrElse

    • stream

    • orElse

    • orElseGet

    • orElseThrow

    • orElseThrow

    • equals

    • hashCode

    • toString