io.hackle.sdk.internal.utils.Json.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hackle-server-sdk Show documentation
Show all versions of hackle-server-sdk Show documentation
Hackle SDK for Java and Kotlin
The newest version!
package io.hackle.sdk.internal.utils
import com.google.gson.Gson
import com.google.gson.GsonBuilder
internal val GSON: Gson = GsonBuilder().create()
internal fun Any.toJson(): String = GSON.toJson(this)
internal inline fun String.parseJson(): T = GSON.fromJson(this, T::class.java)