run.smt.ktest.json.mapper-extensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktest-jackson Show documentation
Show all versions of ktest-jackson Show documentation
kTest Jackson integration + type safe type DSL
package run.smt.ktest.json
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.ObjectMapper
import java.io.File
import java.io.InputStream
import java.io.Reader
import java.net.URL
inline fun ObjectMapper.readValue(stream: InputStream) = readValue(stream, T::class.java)
inline fun ObjectMapper.readValue(file: File) = readValue(file, T::class.java)
inline fun ObjectMapper.readValue(bytes: ByteArray) = readValue(bytes, T::class.java)
inline fun ObjectMapper.readValue(string: String) = readValue(string, T::class.java)
inline fun ObjectMapper.readValue(jp: JsonParser) = readValue(jp, T::class.java)
inline fun ObjectMapper.readValue(reader: Reader) = readValue(reader, T::class.java)
inline fun ObjectMapper.readValue(url: URL) = readValue(url, T::class.java)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy