io.leopard.json.IJson Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leopard-json Show documentation
Show all versions of leopard-json Show documentation
规范、简化Json操作,可选Jackson、FastJson实现。并可在TopNB查看耗时统计信息。
package io.leopard.json;
import java.util.List;
import java.util.Map;
public interface IJson {
/**
* 将对象转成json.
*
* @param obj 对象
* @return
*/
String toJson(Object obj);
/**
* 将对象转成json.
*
* @param obj 对象
* @return
*/
String toFormatJson(Object obj);
/**
* 将Json转换成对象.
*
* @param json
* @param valueTypes
* @return
*/
T toObject(String json, Class clazz);
T toObject(String json, Class clazz, boolean ignoreUnknownField);
List toListObject(String json, Class clazz);
List toListObject(String json, Class clazz, boolean ignoreUnknownField);
List toListObject(List jsonList, Class clazz);
List toListObject(List jsonList, Class clazz, boolean ignoreUnknownField);
Map toMap(String json);
}