Highlighted

Using Project Lombok in AEM Sling Models | AEM 6.5 | Java 11 | AEM Community Blog Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

959

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

959

Correct Answer

1.1K
kautuk_sahni
Community Manager

11-09-2020

BlogImage.jpg

Using Project Lombok in AEM Sling Models | AEM 6.5 | Java 11 by AEM Queries & Solutions

Abstract

Most of the time in our projects we end up creating plain Sling models for dialogs value or for some performing some operations.
In some cases we just need a plain Sling Model where we just want to Inject some variables or create some variable and generate getters and setters for the same , also if you have around more than 20+ variables then you have to first declare those variables and then generate corresponding Getters and Setters which increases the size of your Java class by adding around 60+ extra line of code (if 20 variables).

In such scenarios we can make use of Project Lambok Library to get the Getters and Setters generated at runtime.

Add following maven dependency:



org.projectlombok
lombok
1.18.4
provided


Read Full Blog

Using Project Lombok in AEM Sling Models | AEM 6.5 | Java 11

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager