Skip to content

Instantly share code, notes, and snippets.

@skydoves
Last active February 7, 2024 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skydoves/e74a3c4c02ee834ee7eae631ee24ae73 to your computer and use it in GitHub Desktop.
Save skydoves/e74a3c4c02ee834ee7eae631ee24ae73 to your computer and use it in GitHub Desktop.
netowrk_result_sealed_interface
sealed interface NetworkResult<T : Any>
class Success<T : Any>(val data: T) : ApiResult<T>
class Error<T : Any>(val code: Int, val message: String?) : ApiResult<T>
class Exception<T : Any>(val e: Throwable) : ApiResult<T>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment