package com.elpassion.intelijidea.util

import com.fasterxml.jackson.databind.ObjectMapper
import java.io.Serializable

val objectMapper by lazy { ObjectMapper() }

fun Any.toJson(): String = objectMapper.writeValueAsString(this)

inline fun <reified T : Serializable> String.fromJson(): T = objectMapper.readValue(this, T::class.java)
package com.elpassion.intelijidea.util

import com.fasterxml.jackson.databind.ObjectMapper
import java.io.Serializable

val objectMapper by lazy { ObjectMapper() }

fun Any.toJson(): String = objectMapper.writeValueAsString(this)

inline fun <reified T : Serializable> String?.fromJson(): T? = this?.let { objectMapper.readValue(this, T::class.java) }

Fix problem with Jackson NPE
Fix problem with Jackson NPE

elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin