Package org.linkki.util
Class Optionals.Either<T>
java.lang.Object
org.linkki.util.Optionals.Either<T>
- Enclosing class:
- Optionals
Deprecated.
Wrapper around an
Optional that offers Java 9's Optional#or method.-
Method Summary
-
Method Details
-
or
Deprecated.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
-
Optional.or(Supplier)on theOptionalobject instead.