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

上一篇:【Java基础】static关键字相关


下一篇:async并发处理