skip to Main Content

Json – parse generic sealed class in kotlin using jackson

I have the following generic sealed class representing the status of network response. @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "status") @JsonSubTypes( value = [ JsonSubTypes.Type(value = Response.OK::class, name = "OK"), JsonSubTypes.Type(value = Response.Error::class, name = "ERROR"), ] )…

VIEW QUESTION

Kotlin coroutine with firebase functions

I was having a problem implementing the Firebase anonymous sign-in function with Kotlin coroutine. Following is the code for that: Repository.kt suspend fun getUserId(){ firebaseHelper.getUserId().collect{ if (it == "Successful"){ emit(it) } else { emit("Task unsuccessful") } } } FirebaseHelper.kt fun…

VIEW QUESTION
Back To Top
Search