unwrap method

T unwrap()

Returns success data or throws exception if value is not SuccessData

Implementation

T unwrap() {
  if (this is! SuccessData<T>) {
    throw IllegalStateException(message: 'Not a success data');
  }

  return (this as SuccessData<T>).result;
}