Class Optionals.Either<T>

java.lang.Object
org.linkki.util.Optionals.Either<T>
Enclosing class:
Optionals

@Deprecated(since="2.4.0") public static class Optionals.Either<T> extends Object
Deprecated.
Call Optional.or(Supplier) on the Optional object instead.
Wrapper around an Optional that offers Java 9's Optional#or method.
  • Method Details

    • or

      public Optional<T> or(Supplier<? extends Optional<? extends T>> supplier)
      Deprecated.
      If a value is present, returns an Optional describing the value, otherwise returns an Optional produced by the supplying function.
      Parameters:
      supplier - the supplying function that produces an Optional to be returned
      Returns:
      returns an Optional describing the value of this Optional, if a value is present, otherwise an Optional produced by the supplying function.
      Throws:
      NullPointerException - if the supplying function is null or produces a null result