package com.jt.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.util.StringUtils;
public class ObjectMapperUtil {
private static final ObjectMapper mapper =new ObjectMapper();
//方法一对象转json
/**
*
* @param object 传入需要转换为json串的对象
* @return 目标json串
*/
public static String toJeson(Object object){
try
Utils----ObjectMapperUtil 任意对象与Json相互转换的工具类
最新推荐文章于 2023-11-14 17:27:20 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)