Package org.dmfs.jems2
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'sOptionalthis an interface, so custom implementations can be developed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisPresent()Returns whether the optional value is present.Tvalue()Returns the optional value.
-
-
-
Method Detail
-
isPresent
boolean isPresent()
Returns whether the optional value is present.
-
value
T value()
Returns the optional value.- Throws:
java.util.NoSuchElementException- if the optional value is not present.
-
-