aries / net.globalid.aries.utils.json / JsonManager

JsonManager

interface JsonManager

Json manager

Converting objects to JSON strings and back.

Functions

fromJson

Converts value JSON string to instance of type

abstract fun <T> fromJson(type: Class<T>, value: String): T?

toJson

Converts value to JSON string

abstract fun <T> toJson(type: Class<T>, value: T): String

Companion Object Properties

INSTANCE

lateinit var INSTANCE: JsonManager

Extension Functions

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

Inheritors

MoshiJsonManager

Moshi JSON manager

class MoshiJsonManager : JsonManager