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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM