Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,289 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,168 likes

Total Posts

6,289 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
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