class MoshiJsonManager : JsonManager
Moshi JSON manager
This class implements interface JsonManager for Moshi.
<init> |
Moshi JSON manager MoshiJsonManager(agentMessageProvider: JsonAdapterProvider<AgentMessage> = AgentMessageProvider()) |
moshi |
the Moshi instance val moshi: Moshi! |
fromJson |
fun <T> fromJson(type: Class<T>, value: String): T? |
toJson |
fun <T> toJson(type: Class<T>, value: T): String |
fromJson |
This extension method of JsonManager which reduces boilerplate with converting JSON string to the instance of T. fun <T> JsonManager.fromJson(value: String): T? |
toJson |
This extension method of JsonManager which reduces boilerplate with converting value to the JSON string. fun <T> JsonManager.toJson(value: T): String |