com.futuresight.util.mystique.lever.JsonConvertor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-mystique Show documentation
Show all versions of json-mystique Show documentation
Json Utility to transform Jsons
/*
* Copyright (c) Balajee TM 2016.
* All rights reserved.
* License - @see
*/
/*
* Created on 25 Aug, 2016 by balajeetm
*/
package com.futuresight.util.mystique.lever;
import java.io.InputStream;
import java.util.List;
/**
* The Interface JsonConvertor.
*
* @author balajeetm
*/
public interface JsonConvertor {
/**
* Deserialize.
*
* @param the generic type
* @param objectString the object string
* @param objectType the object type
* @return the t
* @throws ConvertorException the convertor exception
*/
T deserialize(String objectString, Class objectType) throws ConvertorException;
/**
* Deserialize.
*
* @param the generic type
* @param object the object
* @param objectType the object type
* @return the t
* @throws ConvertorException the convertor exception
*/
T deserialize(Object object, Class objectType) throws ConvertorException;
/**
* Deserialize.
*
* @param the generic type
* @param inputStream the input stream
* @param objectType the object type
* @return the t
* @throws ConvertorException the convertor exception
*/
T deserialize(InputStream inputStream, Class objectType) throws ConvertorException;
/**
* Serialize.
*
* @param value the value
* @return the string
* @throws ConvertorException the convertor exception
*/
String serialize(Object value) throws ConvertorException;
/**
* Deserialize group.
*
* @param the generic type
* @param the generic type
* @param objectString the object string
* @param groupClass the group class
* @param elementClass the element class
* @return the t
* @throws ConvertorException the convertor exception
*/
T deserializeGroup(String objectString, Class groupClass, Class elementClass)
throws ConvertorException;
/**
* Deserialize group.
*
* @param the generic type
* @param inputStream the input stream
* @param groupClass the group class
* @param elementClass the element class
* @return the t
* @throws ConvertorException the convertor exception
*/
T deserializeGroup(InputStream inputStream, Class groupClass, Class> elementClass)
throws ConvertorException;
/**
* Deserialize list.
*
* @param the generic type
* @param inputStream the input stream
* @param elementClass the element class
* @return the list
* @throws ConvertorException the convertor exception
*/
List deserializeList(InputStream inputStream, Class elementClass) throws ConvertorException;
/**
* Deserialize list.
*
* @param the generic type
* @param jsonString the json string
* @param elementClass the element class
* @return the list
* @throws ConvertorException the convertor exception
*/
List deserializeList(String jsonString, Class elementClass) throws ConvertorException;
/**
* Deserialize list.
*
* @param the generic type
* @param object the object
* @param elementClass the element class
* @return the list
* @throws ConvertorException the convertor exception
*/
List deserializeList(Object object, Class elementClass) throws ConvertorException;
}