Skip to content

Instantly share code, notes, and snippets.

@0OZ
Created April 22, 2022 08:55
Show Gist options
  • Save 0OZ/59332d8cb05cf4d52cfca9ecf4ce789c to your computer and use it in GitHub Desktop.
Save 0OZ/59332d8cb05cf4d52cfca9ecf4ce789c to your computer and use it in GitHub Desktop.
Deserialization.kt
inline fun <reified T> deserialization(json: String): T =
jacksonObjectMapper().registerKotlinModule().readValue(json) as T
// ---
fun foo(){
val boo = deserialization(message) as Boo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment