Questions tagged [lombok]

Project Lombok is a tool for reducing boilerplate code in Java through annotations and compile time code generation.

The details for project Lombok can be found at http://projectlombok.org/.

The primary functionality of Lombok is reducing the boilerplate code in JavaBeans by replacing all setters, getters, equals, hashCode and toString with a single @Data annotation on the class.

Many other useful features are offered and the project is under active development.

2384 questions
0
votes
1 answer

mapstruct only convert parent fields when source bean and target bean both inheit parent using lombok

As bellow, I have OpenSecretEntity which extends BasicEntity and OpenSecretDto which extends BasicDto. When i use OpenSecretStructMapper with @Mapper of mapstruct to convert OpenSecretEntity to OpenSecretDto , the implementation of mapstruct only…
xw z
  • 1
0
votes
0 answers

How generated setter inside implements class from MapStruct

greetings to all, in an example of a course we have used an entity and its corresponding entity that acts as a DTO that is called entidadRest but that annotates it with @json, what advantage does this approach have when performing DTOS, I am…
anodino
  • 11
  • 2
0
votes
1 answer

How to serialize an abstract getter using Lombok and Gson?

the goal is to force the override of the getter which returns a constant when I serialize. I search a solution on classes side, not on the serializer. import lombok.Data; import lombok.Getter; import lombok.Setter; import com.google.gson.Gson; …
Larvis
  • 3
  • 3
0
votes
1 answer

@SuperBuilder in lombok don't override method build()?

I use @SuperBuilder() in 2 class, I want override method build() of class child builder but it appear error "Abstract method 'build()' cannot be accessed directly" in line super.build() in ClassChild Version Lombok: 1.18.28 Version java:…
Hoang
  • 829
  • 11
  • 18
0
votes
0 answers

Lombok not working with Java 11 and IntelliJ

I have a Spring Boot application with Java 11. I am using IntelliJ 2022.1.4 (Ultimate Edition). Lombok plug-in is installed and enabled in the IDE - version bundled 221.6008.13. In my pom.xml I have the maven dependency for project Lombok - version…
0
votes
1 answer

Why am I getting java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor error?

I know there are other similar questions like this, but I have gone through all of them, and none worked for me, hence my asking it here. I'm using gradle for my project, and when I build, it builds successfully, but when I try to compile…
user8107351
  • 367
  • 4
  • 20
0
votes
0 answers

unable to create object in java with lombok noargsconstructor added with Pojo Cla

unable to create object in java with lombok **noargsconstructor **added with Pojo Class I have created a** POJO class Employee**. Code mentioned below- @Data @NoArgsConstructor @AllArgsConstructor(access = AccessLevel.PUBLIC) @Builder public class…
0
votes
0 answers

Lombok issues compilating my java project

I'm trying to compile a java file but I get a lombok error, I searched for a solution and apparenly I got to update lombok. I searched for how to update it on IntelliJ but I didn't find anything. Can someone please help me ? error Unable to make…
0
votes
1 answer

java.lang.NoClassDefFoundError: com/datastax/oss/driver/api/mapper/entity/naming/GetterStyle

I am building Cassandra datastax 4.14 with Spring Boot and gradle 7.6 Gradle file: plugins { id 'java' id 'org.springframework.boot' version "2.3.5.RELEASE" id 'io.spring.dependency-management' version "1.0.9.RELEASE" id…
0
votes
2 answers

Spring Data JPA Stackoverflow error @OneToMany mapping when saving

I'm learning spring boot. I have a GYMS table and HOURS table. I declared a @OneToMany mapping on the gym entity and @ManyToOne mapping on the hours entity. However, when I attempt to save a new gym and its hours in the database I get a…
0
votes
2 answers

@Slf4j Lombok annotation not working with Java + Gradle

I'm fairly new to Java and trying to implement a logger with @Slf4j annotation provided by lombok. From my understanding it should be fairly simple, just provide the annotation to the class and it will create the method for that class but it seems…
Revlis
  • 1
  • 1
  • 1
0
votes
1 answer

lombok.javac.apt.LombokProcessor can't access com.sun.tools.javac.processing.JavacProcessingEnvironment due to module restrictions

I am facing this error while running command: mvn clean install -DskipTests The error: class lombok.javac.apt.LombokProcessor (in unnamed module @0x7e7740a5) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module…
0
votes
0 answers

Code completion (Control + SPACE) doesn't work when Lombok is enabled with IntelliJ Idea and Android Studio

I am using IntelliJ Idea 2023.1 and Android Studio Flamingo. When I've installed Lombok by coping it to plugin folder instead of from market place (because is not available) I've noticed that Control + SPACE - auto completion code doesn't work.…
0
votes
0 answers

.() java.lang.NoSuchMethodException with beforeAllCallback precondition class

I have a task where need to write alternative for TestNG @BeforeSuite using only Junit, where this extension will create test data and shared it to test class. After long research I found a good solution based on Junit API (BeforeAllCallback and…
0
votes
0 answers

Spring quietly doesn't load config if Config classes have Builder and no default constructor. Why doesnt startup fail?

I am facing a situation where a previously working config load stopped working after the Lombok builder annotation was added to a Config class. What's more perplexing is that Spring doesn't even fail startup or even warn in logs about this. Here is…
Teddy
  • 4,009
  • 2
  • 33
  • 55
1 2 3
99
100