I have this method:
public static Object parseStringToObject(String json) { String Object = json; Gson gson = new Gson(); Object objects = gson.f
Don't forget to convert your object into Json first using Gson()
val fromUserJson = Gson().toJson(notificationRequest.fromUser)
Then you can easily convert it back into an object using this awesome library
val fromUser = Gson().fromJson(fromUserJson, User::class.java)