com.region.common.adapter.json.JSONAdapter Maven / Gradle / Ivy
package com.region.common.adapter.json;
import java.lang.reflect.Type;
/**
* The Json Adapter, JSON adapters include Jackson and Gson Only
*
* @author liujeiyu
* @date 2023/5/28 13:50
* @desciption
*/
public interface JSONAdapter {
/**
* Get the adaptation object
*
* @return
*/
T getTarget();
/**
* Converting objects to json strings
*
* @param object
* @return
*/
String toJSONString(Object object);
/**
* Convert a json string to an object
*
* @param json
* @return
*/
Object toObject(String json);
/**
* Convert a json string to an object
*
* @param json
* @return
*/
K toObject(String json, Class clazz);
/**
* Convert a json string to an object
*
* @param json
* @return
*/
Object toObject(String json, Type type);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy