Stable - Project Lombok
文章推薦指數: 80 %
Running delombok. Delombok copies your source files to another directory, replacing all lombok annotations with their desugared form. So, it'll turn @Getter ... ProjectLombok Features Stable Experimental Community Discuss/Help Issues Documentationforcontributors ContacttheteambehindProjectLombok Order/Donate Howtouse Install Javac ECJ maven gradle ant kobalt Eclipse IntelliJIDEA Netbeans MyEclipse SpringToolSuite JBossDeveloperStudio VisualStudioCode Android GWT Download GetLombokforEnterprise Lombokfeatures TheLombokjavadocisavailable,butweadvisethesepages. val Finally!Hassle-freefinallocalvariables. var Mutably!Hassle-freelocalvariables. @NonNull or:HowIlearnedtostopworryingandlovetheNullPointerException. @Cleanup Automaticresourcemanagement:Callyourclose()methodssafelywithnohassle. @Getter/@Setter NeverwritepublicintgetFoo(){returnfoo;}again. @ToString Noneedtostartadebuggertoseeyourfields:JustletlombokgenerateatoStringfor you! @EqualsAndHashCode Equalitymadeeasy:GenerateshashCodeandequalsimplementationsfromthe fieldsofyourobject.. @NoArgsConstructor,@RequiredArgsConstructorand@AllArgsConstructor Constructorsmadetoorder:Generatesconstructorsthattakenoarguments,oneargumentperfinal/ non-nullfield,oroneargumentforeveryfield. @Data Alltogethernow:Ashortcutfor@ToString,@EqualsAndHashCode, @Getteronallfields,and@Setteronallnon-finalfields,and @RequiredArgsConstructor! @Value Immutableclassesmadeveryeasy. @Builder ...andBob'syouruncle:No-hasslefancy-pantsAPIsforobjectcreation! @SneakyThrows Toboldlythrowcheckedexceptionswherenoonehasthrownthembefore! @Synchronized synchronizeddoneright:Don'texposeyourlocks. @With Immutable'setters'-methodsthatcreateaclonebutwithonechangedfield. @Getter(lazy=true) Lazinessisavirtue! @Log Captain'sLog,stardate24435.7:"Whatwasthatlineagain?" experimental Headtothelab:Thenewstuffwe'reworkingon. Configurationsystem Lombok,madetoorder:Configurelombokfeaturesinoneplaceforyourentireprojectorevenyourworkspace. Runningdelombok Delombokcopiesyoursourcefilestoanotherdirectory,replacingalllombokannotationswiththeirdesugaredform.So,it'llturn@Getterbackintotheactualgetter.Itthenremovestheannotation.Thisisusefulforallsortsofreasons;youcancheckoutwhat'shappeningunderthehood,iftheunthinkablehappensandyouwanttostopusinglombok,youcaneasilyremovealltracesofitinyoursource,andyoucanusedelomboktopreprocessyoursourcefilesforsource-leveltoolssuchasjavadocandGWT.Moreinformationabouthowtorundelombok,includinginstructionsforbuildtoolscanbefoundatthedelombokpage.
延伸文章資訊
- 1IT|軟體|開發|Lombok @Data - iT 邦幫忙
為了讓Eclipse識別lombok,除了引入lombok JAR包之外,你需要安裝lombok, ... Lombok 的特色是根據 annotation 創建一些程式碼,以減少重復程式碼的數...
- 2The Ultimate Lombok Annotations Guide | Nullbeans.com
The @Synchronized annotation is a method level annotation. According to Lombok, using this annota...
- 3A Complete Guide to Lombok - Auth0
Project Lombok (from now on, Lombok) is an annotation-based Java library that allows you to reduc...
- 4Stable - Project Lombok
Running delombok. Delombok copies your source files to another directory, replacing all lombok an...
- 5Write Fat-free Java Code with Project Lombok | Toptal
Lombok acts as an annotation processor that “adds” code to your classes at compile time. Annotati...