lombok-ex/README-ENGLISH.md at master - GitHub

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

package com.github.houbb.lombok.test.model; import java.io.Serializable; public class User implements Serializable { private static final Long ... Skiptocontent {{message}} houbb / lombok-ex Public Notifications Fork 18 Star 21 Code Issues 3 Pullrequests 0 Actions Projects 0 Wiki Security Insights More Code Issues Pullrequests Actions Projects Wiki Security Insights Permalink master Branches Tags Couldnotloadbranches Nothingtoshow {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default lombok-ex/README-ENGLISH.md Gotofile Gotofile T Gotoline L Copypath Copypermalink Thiscommitdoesnotbelongtoanybranchonthisrepository,andmaybelongtoaforkoutsideoftherepository.     Cannotretrievecontributorsatthistime lombok-ex Creativepurpose Features CHANGELOG QuickStart Require mavenimport @Serialannotation compile result @Utilannotation usage result @ToStringannotation usage result ConfigType javacode classresult @Sync Usage result @Modifiers Intro Usage result Road-map 308lines(199sloc) 5.64KB Raw Blame OpenwithDesktop Viewraw Viewblame lombok-ex 中文文档 lombok-exisacompile-timeannotationframeworksimilartolombok. Mainlyaddsomecommontoolsthatlombokdoesnotimplement,andyouwilluseyourself. Thereisnolossinannotationperformanceatcompiletime.Oneannotationdoeseverything,nothird-partydependencies. Creativepurpose -Addedmissingannotationsoflomboktofacilitatedailydevelopmentanduse. -Thesourcecodeoflombokisbasicallyunreadable,itshouldbeencrypted. -Provideabasisforimprovingtheperformanceofotherannotation-relatedframeworks,andconsiderreplacingthemwithcompile-timeannotationslater. Features @Serial @Util @ToString @Sync @Modifiers CHANGELOG CHANGELOG QuickStart Require jdk1.7+ maven3.x+ enableannotationprocess。

Ifyouuseeditor,pleasechecked【enableannotationprocess】 mavenimport com.github.houbb lombok-ex 0.0.8 provided Gradleimport compilegroup:'com.github.houbb',name:'lombok-ex',version:'0.0.8' @Serialannotation User.java Wecanuse@Seriallikethis: packagecom.github.houbb.lombok.test.model; importcom.github.houbb.lombok.ex.annotation.Serial; @Serial publicclassUser{ privateStringname; publicStringgetName(){ returnname; } publicvoidsetName(Stringname){ this.name=name; } } compile usemavencommand $mvncleaninstall result seetheUser.class,contentisasfollowing: packagecom.github.houbb.lombok.test.model; importjava.io.Serializable; publicclassUserimplementsSerializable{ privatestaticfinalLongserialVersionUID=1L; privateStringname; publicUser(){ } publicStringgetName(){ returnthis.name; } publicvoidsetName(Stringname){ this.name=name; } } @Utilannotation usage @Util publicclassStringUtil{ publicstaticbooleanisEmpty(finalStringstring){ returnnull==string||"".equals(string); } } result publicfinalclassStringUtil{ privateStringUtil(){ } publicstaticbooleanisEmpty(Stringstring){ returnnull==string||"".equals(string); } } @ToStringannotation usage importcom.github.houbb.lombok.ex.annotation.ToString; @ToString publicclassToStringTest{ } result ps:ThisisdependentonFastJson,youneedimportitbyyourself. importcom.alibaba.fastjson.JSON; publicclassToStringTest{ publicToStringTest(){ } publicStringtoString(){ returnJSON.toJSONString(this); } } ConfigType @ToStringcanalsoconfigthetoString()generatetype. javacode @ToString(ToStringType.CONCAT) publicclassToStringConcatTest{ privateStringname; privateintage; privateint[]ints; } classresult importjava.util.Arrays; publicclassToStringConcatTest{ privateStringname; privateintage; privateint[]ints; publicToStringConcatTest(){ } publicStringtoString(){ return"ToStringConcatTest{name="+this.name+",age="+this.age+",ints="+Arrays.toString(this.ints)+"}"; } } @Sync Usage @Sync publicvoidsyncTest(){ System.out.println("sync"); } result publicsynchronizedvoidsyncTest(){ System.out.println("sync"); } @Modifiers Intro Youcanmodifytheaccesslevelofclasses,methods,andfieldswith@Modifiers. Theremaybenoparticularlygoodapplicationscenariosforthetimebeing,dependingontheuser'sownuse. Note:Donotengageinsomethingthatisdifficulttounderstand,aseasyaspossibleforuserstounderstand. Usage @ModifiershasappendModeattr,defaultistrue。

Ifsettofalse,youcandirectlychangethemodifiertotheonespecifiedbytheuser. importcom.github.houbb.lombok.ex.annotation.Modifiers; importcom.github.houbb.lombok.ex.constant.Flags; @Modifiers(Flags.FINAL) publicclassModifiersTest{ @Modifiers(Flags.VOLATILE) privateintvalue; @Modifiers(Flags.SYNCHRONIZED) publicstaticvoidsyncTest(){ System.out.println("sync"); } } result publicfinalclassModifiersTest{ privatevolatileintvalue; publicModifiersTest(){ } publicstaticsynchronizedvoidsyncTest(){ System.out.println("sync"); } } Road-map ConfigandOptimize @AutoLogimplements @Equals@HashCode@EqualsAndHashCodeimplements @NotNullforargumentcheck,likevalid @Asyncasyncexecuteasync bean-mapping,sensitive ASTbasicframework Idea:parsethetextdirectlythroughAST,andthenrebuildtheclassfilethroughASTcombinedwithjdkutils. Go Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?