package cn.com.countrygarden.bi.main.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

/**
 * <pre>
 *json转换
 * </pre>
 *
 * @author 陈幸浩
 * @version 1.00.00
 */
@Slf4j
public class JsonUtils {

    private static ObjectMapper objectMapper = new ObjectMapper();

    public static String toJson(Object object) {
        try {
            return objectMapper.writeValueAsString(object);
        } catch (Exception var2) {
            log.error("对象转换为json时出错", var2);
            return "{json parsing error !!!!!!!!!!!!!!}";
        }
    }
    
}
