valueOr method
- T defaultValue
Returns the expected value if it exists, otherwise returns defaultValue.
Implementation
T valueOr(T defaultValue) {
return _hasValue ? (_value as T) : defaultValue;
}
Returns the expected value if it exists, otherwise returns defaultValue.
T valueOr(T defaultValue) {
return _hasValue ? (_value as T) : defaultValue;
}