org.biacode.escommons.toolkit.component.JsonComponent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of escommons-toolkit Show documentation
Show all versions of escommons-toolkit Show documentation
Elasticsearch commons library.
package org.biacode.escommons.toolkit.component
import com.fasterxml.jackson.core.type.TypeReference
import java.io.InputStream
/**
* Created by Arthur Asatryan.
* Date: 7/10/17
* Time: 6:11 PM
*/
interface JsonComponent {
/**
* Deserialize from String source.
*
* @param the type parameter
* @param source the source
* @param clazz the clazz
* @return the deserializeFromString object
*/
fun deserializeFromString(source: String, clazz: Class): T
/**
* Deserialize from InputStream source.
*
* @param the type parameter
* @param source the source
* @param clazz the clazz
* @return the deserializeFromString object
*/
fun deserializeFromInputStream(source: InputStream, clazz: Class): T
/**
* Deserialize from InputStream source and type reference.
*
* @param the type parameter
* @param source the source
* @param typeReference the type reference
* @return the deserializeFromString object
*/
fun deserializeFromInputStreamWithTypeReference(source: InputStream, typeReference: TypeReference): T
/**
* Serialize object to string
*
* @param the type parameter
* @param source the source
* @param clazz the clazz
* @return the serialize string
*/
fun serialize(source: Any): String
}