All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.biacode.escommons.toolkit.component.JsonComponent.kt Maven / Gradle / Ivy

There is a newer version: 7.3.2_0.1.0
Show newest version
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy