maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult $boolean(
- OptionValueBoolean value
- TResult empty(
- OptionValueEmpty value
- TResult integer(
- OptionValueInteger value
- TResult $string(
- OptionValueString value
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(OptionValueBoolean value)? $boolean,
TResult Function(OptionValueEmpty value)? empty,
TResult Function(OptionValueInteger value)? integer,
TResult Function(OptionValueString value)? $string,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case OptionValueBoolean.constructor:
if ($boolean != null) {
return $boolean.call(this as OptionValueBoolean);
}
break;
case OptionValueEmpty.constructor:
if (empty != null) {
return empty.call(this as OptionValueEmpty);
}
break;
case OptionValueInteger.constructor:
if (integer != null) {
return integer.call(this as OptionValueInteger);
}
break;
case OptionValueString.constructor:
if ($string != null) {
return $string.call(this as OptionValueString);
}
break;
}
return orElse.call();
}