How to quickly generate getter setter methods for variables in ...

文章推薦指數: 80 %
投票人數:10人

How to quickly generate getter setter methods for variables in spring boot projects created by idea? According to Baidu's use of generate, ... Position:Home> Howtoquicklygenerategettersettermethodsforvariablesinspringbootprojectscreatedbyidea? DWQAQuestions›Category:DevelopmentTool›Howtoquicklygenerategettersettermethodsforvariablesinspringbootprojectscreatedbyidea? 0 VoteUp VoteDown TonyChineseCabbageasked1yearago Howtoquicklygenerategettersettermethodsforvariablesinspringbootprojectscreatedbyidea? AccordingtoBaidu’suseofgenerate,therearenogetterandsettermethodsintheoptions,onlythesefive.Howtoconfigureit? QuestionTags:intellij-idea,java,springboot 6Answers 0 VoteUp VoteDown FrogsinCrystalPalaceanswered1yearago YoucanintroduceLombokintoprojectstoavoidwritinggetsetmethods,Youcanalsouseideatogeneratedirectly,providedtherearevariables.Youhaveonlymethodsinthis,butnovariables.Gettersandsettersaregenerallyforvariables.Forexample:publicclassUser{ privateIntegerid; privateStringname; } Therightmousebuttonwillhavegenerate 0 VoteUp VoteDown rrrrrrrrrranswered1yearago 1.Whyidea?Becauseit’sveryidea2.Youdon’thavevariables,soitdoesn’tshowgetterandsetteroptions3.Addavariableandtryagain 0 VoteUp VoteDown Amonkeyinmudanswered1yearago ItisrecommendedtoinstallaLombokplug-intosimplifyentityclassesandgenerategetterandsettermethodsautomaticallyAndnovariableswillnotshowthevalueofgetterandsetter 0 VoteUp VoteDown Whileyou'reyounganswered1yearago Makesureyou’vedonetwothings. IntroducingLombokdependenciesintoprojects org.projectlombok lombok true Lombokpluginofidea https://plugins.jetbrains.com… Useexample:Annotation@dataisasupersetoftheunionof@setterand@getter. @Dataisaconvenientshortcutannotationthatbundlesthefeaturesof@ToString,@EqualsAndHashCode,@Getter/@Setterand@RequiredArgsConstructortogether @Data privateclassResultBean{ privateStringstr; } publicvoidlombokTest(){ ResultBeanresultBean=newResultBean(); resultBean.setStr("HelloLombok"); Stringlombok=resultBean.getStr(); log.info(lombok); } loong replied1yearago @Dataisasupersetoftheunionof@getterand@setter Whileyou'reyoung replied1yearago urright 0 VoteUp VoteDown woaiyoubaoanswered1yearago TherearevariablesinALT+insert 0 VoteUp VoteDown Coder'snotesanswered1yearago Setgetisaclassvariable,notaformalparameter Searchfor: Tagsaddress algorithm array assembly attribute Browser c Catalog Characterstring Client code command configurationfile container data Database Definition Edition element Example file function java javascript Journal linux Memory method Modular mysql node object page parameter php Plug-inunit process project python Route sourcecode Theserver Thread time user RecentPosts UsingPythondocxtosetupasimpleworddocumenttemplate ASP.NetcoreusesEFcore Multithreadinglearningnotes04threadsynchronization Somescenariosofrxjavacooperatingwithretrofit LinuxProgrammingPart1:installationofLinuxenvironmentwhentheimagehasbeendownloaded(thesecondscheme) RecentCommentsThengohikingonAnswerforWhatistheprincipleofHTTPproxyIP?ItponyonAnswerforWhatistheprincipleofHTTPproxyIP?YianonAnswerforUsethenumbers1,2,3,4,5,6,7,8and9tocalculateallpossiblevaluesof100liuzhengonAnswerforUsethenumbers1,2,3,4,5,6,7,8and9tocalculateallpossiblevaluesof100BackandteaonAnswerforUsethenumbers1,2,3,4,5,6,7,8and9tocalculateallpossiblevaluesof100Categories .NETCore AgileDevelopment AlgorithmAndDataStructure Android AppleMAC ArchitectureDesign ArtificialIntelligence ASP.NET Backend Blockchain C C# C++ Cloud Database DesignPattern DevelopmentTool Embedded Erlang Freshman Game Golang HTML/CSS HTML5 InformalEssay InformationSecurity IOS Java JavaScript JSP Linux Lua MongoDB MsSql MySql NetworkSecurity OOP oracle OtherDB OtherTechnologies OtherTechnology Perl PHP Program Python Redis RegularExpression Ruby Rust SAP Server SoftwareTesting VBS VUE WEBFrontEnd Windows XML/XSLT java php python linux windows android ios mysql html .net github node.js Copyright©2021DevelopPaperAllRightsReserved    Sitemap    AboutDevelopPaper    PrivacyPolicy    ContactUs



請為這篇文章評分?