This is a single java project where I practiced lombok. You will find the example running commands in App.java
file
1. @Getter
2. @Setter
3. @EqualsAndHashCode(of = {"sentence", "val"})
4. @ToString(exclude = "val")
5. @Builder
6. @RequiredArgsConstructor, generates a constructor for all final fields, with parameter order same as field order
7. @NoArgsConstructor creates an empty constructor.
8. @AllArgsConstructor creates a constructor for all fields
If you are using intellij, need to activate annotations processor: Settings -> Compiler -> Annotation Processors
Now install lombok plugin:
Preferences -> Plugins
Click Browse repositories...
Search for "Lombok Plugin"
Install
Restart IntelliJ
See the pom.xml file to see what line is doing what
mvn package
mvn exec:java -Dexec.mainClass="com.ayon.app.App"
Project structure:
.
βββ README.md
βββ pom.xml
βββ src
βββ main
βββ java
βββ com
βββ ayon
βββ app
βΒ Β βββ App.java
βββ lombok
βΒ Β βββ ex1
βΒ Β βΒ Β βββ LombokExample.java
βΒ Β βββ ex2
βΒ Β βΒ Β βββ LombokExample2.java
βΒ Β βββ ex3
βΒ Β βΒ Β βββ LombokExample3.java
βΒ Β βββ ex4
βΒ Β βΒ Β βββ LombokExample4.java
βΒ Β βββ ex5
βΒ Β βΒ Β βββ LombokExample5.java
βΒ Β βββ ex6
βΒ Β βΒ Β βββ LombokExample6.java
βΒ Β βββ ex8
βΒ Β βββ LombokExample8.java
βββ service
βββ RunningLomboks.java
βββ RunningLomboksTest.java