JavaBean toString() - 将bean对象打印成字符串

JavaBean toString方式


https://www.cnblogs.com/thiaoqueen/p/7086195.html

//方法一:自动生成
@Override
public String toString() {
return "ReportDataQo [eventCode=" + eventCode + ", reportDateFrom="
+ reportDateFrom + ", reportDateTo=" + reportDateTo
+ ", status=" + status + ", reportOrgCode=" + reportOrgCode
+ ", reportDeptType=" + reportDeptType + "]";
}


//方法二:序列化
/* @Override
public String toString() {
return com.alibaba.fastjson.JSON.toJSONString(this);
}*/

 

other refs:

https://blog.csdn.net/xgdofull/article/details/5424417
https://blog.csdn.net/froole/article/details/2844000

 

posted @ 2019-02-01 13:44  petercao  阅读(5275)  评论(0编辑  收藏  举报