Package org.apache.wayang.core.util
Class Optional<T>
java.lang.Object
org.apache.wayang.core.util.Optional<T>
Utility similar to
Optional
. However, it supports null
as a valid value.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Optional
public Optional()
-
-
Method Details
-
isAvailable
public abstract boolean isAvailable()- Returns:
- whether this instance contains a value.
-
getValue
- Returns:
- the value contained by this instance
- Throws:
IllegalStateException
- ifisAvailable()
isfalse
-
stream
- Returns:
- a
Stream
containing the optional value
-
na
Create a n/a instance.- Returns:
- an
Optional
without a value
-
of
Create a new instance with the givenvalue
.- Parameters:
value
- the value of the newOptional
- Returns:
- the new instance
-