The difference between null and isEmpty in Groovy

If the print result of data from SQLServer Data Base is null, you should use null;

if the print result of data from SQLServer Data Base is nothing, you should use isEmpty.


for example:


log.info table.column

display:null

assert(table.column==null)


log.info table.column

display:

assert(table.column.isEmpty())

發佈了33 篇原創文章 · 獲贊 1 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章