Interface Optional<T>

All Known Implementing Classes:
Absent, Backed, Collapsed, Conditional, DelegatingOptional, First, FirstPresent, Frozen, Just, LazyDelegatingOptional, MapCollapsed, MapEntry, Mapped, Next, NextPresent, NullSafe, Present, Restrained, Sieved, Zipped

public interface Optional<T>
An optional value. In contrast to Java's Optional this an interface, so custom implementations can be developed.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the optional value is present.
    Returns the optional value.
  • Method Details

    • isPresent

      boolean isPresent()
      Returns whether the optional value is present.
    • value

      T value()
      Returns the optional value.
      Throws:
      NoSuchElementException - if the optional value is not present.