haroldadmin
08/12/2019, 5:56 AM@GET("/")
suspend fun getSomething(): MySealedClass<SuccessType, ErrorType>I am unable to figure out how to do the delegation part. I have a call of the typewill ask Retrofit for a CallAdapter to handlesuspend fun whatever(): Whatever. Knowing this, you can register aCall<Whatever>which looks forCallAdapter.Factory, delegates to the built-in factory forCall<YourSealedClass<BodyType>>, and then wraps the value inCall<BodyType>. This will allowYourSealedClassto work–no extension needed.suspend fun whatever(): YourSealedClass<Whatever>
Call<MySealedClass<SuccessType, E>>Call<SuccessType>Call<SuccessType>