transformNullable<S> method
Transforms the Optional value.
If the Optional is absent(), returns absent() without applying the transformer.
Returns absent() if the transformer returns null
.
Implementation
Optional<S> transformNullable<S>(S? Function(T value) transformer) {
return _value == null
? Optional<S>.absent()
: Optional<S>.fromNullable(transformer(_value!));
}