Last active
February 7, 2024 07:25
-
-
Save skydoves/e74a3c4c02ee834ee7eae631ee24ae73 to your computer and use it in GitHub Desktop.
netowrk_result_sealed_interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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