com.github.hdy.common.util.Jsons Maven / Gradle / Ivy
package com.github.hdy.common.util;
import java.util.List;
import java.util.Map;
public abstract class Jsons {
public static final String toJSONString(Object o) {
return ObjectMappers.toJSONString(o);
}
public static final String toJSONString(Object o, boolean prettyFormat) {
return ObjectMappers.toJSONString(o, prettyFormat);
}
public static final String toJSONString(Object o, String dateFormat) {
return ObjectMappers.toJSONString(o, dateFormat);
}
public static final String toJSONString(Object o, String dateFormat, boolean prettyFormat) {
return ObjectMappers.toJSONString(o, dateFormat, prettyFormat);
}
public static T toBean(String jsonString, Class clazz) {
return ObjectMappers.toBean(jsonString, clazz);
}
public static T toBean(String jsonString, Class clazz, String dateFormat) {
return ObjectMappers.toBean(jsonString, clazz, ObjectMappers.newMapper(dateFormat));
}
public static List