castTo<E> method

Maybe<E> castTo<E>()

This method usually used in the same package

Implementation

Maybe<E> castTo<E>() {
  if (hasValue) {
    return Maybe<E>(data: _value as E, error: null);
  } else {
    return Maybe<E>(data: null, error: _error);
  }
}