IntelliJ IDEA快速創(chuàng)建getter和setter方法
IDEA快速創(chuàng)建getter和setter方法
找到generate
我的是Mac,右擊鼠標(biāo)就可以打開,相信windows也不難。
選擇getter和setter
選擇成員變量
測(cè)試
開發(fā)的時(shí)候記得使用喲,我就是想變成習(xí)慣,慢慢學(xué)習(xí)!
ps:IDEA自動(dòng)生成屬性getter setter方法
右擊代碼編輯框空白區(qū)
點(diǎn)擊生成
選中屬性
生成getter setter 方法
IntelliJ IDEA中簡(jiǎn)化getter和setter寫法
1.簡(jiǎn)化getter和setter方法插件
步驟1:pom.xml文件的<dependencies></dependencies>中加入如下代碼
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.6</version> </dependency>
步驟2:maven同步步驟3:在要寫入的javabean類的上方加入@Data并import,即可使用無(wú)須添加getter和setter方法
總結(jié)
到此這篇關(guān)于IntelliJ IDEA快速創(chuàng)建getter和setter方法的文章就介紹到這了,更多相關(guān)IDEA 創(chuàng)建getter和setter內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. python如何實(shí)現(xiàn)word批量轉(zhuǎn)HTML2. python excel和yaml文件的讀取封裝3. python3實(shí)現(xiàn)往mysql中插入datetime類型的數(shù)據(jù)4. python爬蟲實(shí)戰(zhàn)之制作屬于自己的一個(gè)IP代理模塊5. moment轉(zhuǎn)化時(shí)間戳出現(xiàn)Invalid Date的問(wèn)題及解決6. Android中的緩存7. 關(guān)于 Android WebView 的內(nèi)存泄露問(wèn)題8. java——Byte類/包裝類的使用說(shuō)明9. Python中內(nèi)建模塊collections如何使用10. Spring boot整合連接池實(shí)現(xiàn)過(guò)程圖解
