fromJson

abstract fun <T : Any> fromJson(json: String, clazz: KClass<T>): T

Deserializes the given JSON string into an object of the specified type.

Return

An instance of the specified type containing data parsed from the JSON string.

Parameters

json

The JSON string to be deserialized.

clazz

The KClass of the type into which the JSON string should be converted.