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
Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.
package io.github.serpro69.kfaker
import com.fasterxml.jackson.databind.*
import com.fasterxml.jackson.dataformat.yaml.*
import com.fasterxml.jackson.module.kotlin.*
import java.io.*
internal object Mapper {
private val mapper = ObjectMapper(YAMLFactory())
init {
mapper.registerModule(KotlinModule())
}
fun readValue(inputStream: InputStream, type: Class): T = mapper.readerFor(type).readValue(inputStream)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy