Package org.linkki.util
Class Optionals.Either<T>
- java.lang.Object
-
- org.linkki.util.Optionals.Either<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<T>or(Supplier<? extends Optional<? extends T>> supplier)If a value is present, returns anOptionaldescribing the value, otherwise returns anOptionalproduced by the supplying function.
-
-
-
Method Detail
-
or
public Optional<T> or(Supplier<? extends Optional<? extends T>> supplier)
If a value is present, returns anOptionaldescribing the value, otherwise returns anOptionalproduced by the supplying function.- Parameters:
supplier- the supplying function that produces anOptionalto be returned- Returns:
- returns an
Optionaldescribing the value of thisOptional, if a value is present, otherwise anOptionalproduced by the supplying function. - Throws:
NullPointerException- if the supplying function isnullor produces anullresult
-
-