Package com.io7m.cedarbridge.runtime.api
Interface CBOptionType<T extends CBSerializableType>
- Type Parameters:
T- The type of values
- All Superinterfaces:
CBSerializableType,Formattable
public sealed interface CBOptionType<T extends CBSerializableType>
extends Formattable, CBSerializableType
permits CBNone<T>, CBSome<T>
The option type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends CBSerializableType>
CBOptionType<T>fromOptional(Optional<T> opt) Convert the given Java optional value to an option value.Methods inherited from interface java.util.Formattable
formatTo
-
Method Details
-
asOptional
- Returns:
- This value as a Java Optional
-
fromOptional
Convert the given Java optional value to an option value.- Type Parameters:
T- The type of contained values- Parameters:
opt- The Java optional- Returns:
- The option value
-