-
Notifications
You must be signed in to change notification settings - Fork 6.5k
SerializerFeature_FAQ_CN
wenshao edited this page Apr 8, 2016
·
2 revisions
引入版本 1.2.9,用于将非字符串类型的boolean/char/byte/int/long/float/double/Boolean/Character/Byte/Integer/Long/Float/Double/BigInteger/BigDecimal输出为字符串类型。
public class VO {
public boolean id;
}
VO vo = new VO();
vo.id = true;
Assert.assertEquals("{\"id\":\"true\"}"
, JSON.toJSONString(vo, SerializerFeature.WriteNonStringValueAsString));
Assert.assertEquals("{\"id\":true}", JSON.toJSONString(vo));
如有需要修改本注脚,请联系阿里巴巴,
© Alibaba Fastjson Develop Team
注明: 版权所有阿里巴巴,请注明版权所有者
If you need to amend this footnote, please contact Alibaba.
© Alibaba Fastjson Develop Team
Note: Copyright Alibaba, please indicate the copyright owner