io.github.serpro69.kfaker.Mapper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-faker Show documentation
Show all versions of kotlin-faker Show documentation
https://github.com/serpro69/kotlin-faker
package io.github.serpro69.kfaker
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import java.io.InputStream
internal object Mapper {
private val mapper = ObjectMapper()
init {
mapper.registerModule(KotlinModule.Builder().build())
}
fun readValue(inputStream: InputStream, type: Class): T = mapper.readerFor(type).readValue(inputStream)
}