美文网首页
JSON.toJSONString

JSON.toJSONString

作者: _瑾_ | 来源:发表于2021-11-03 23:10 被阅读0次

fastjson

# java code 

 JSON.toJSONString(demoBean,
                SerializerFeature.PrettyFormat,
                SerializerFeature.WriteNonStringKeyAsString,
                SerializerFeature.WriteNullNumberAsZero,
                SerializerFeature.WriteNullListAsEmpty,
                SerializerFeature.WriteNullStringAsEmpty,
                SerializerFeature.WriteNullBooleanAsFalse);

// output 
{
    "department":"",
    "isDelete":false,
    "list":[],
    "map":{"1":"ddd"},
    "name":""
}

相关文章

网友评论

      本文标题:JSON.toJSONString

      本文链接:https://www.haomeiwen.com/subject/whkhzltx.html