Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

459
Views
Lombok @Data annotation changes the name of a field from isood to good

I have this DTO which uses @Data annotation of lombok in order to generate getters and setters:

@Data
public class SomeDto {

  protected boolean isGood;
}

The weird thing is that now my getter has been renamed from getisGood() to isGood() and the setter has the name setGood() instead of setIsGood(). Example:

SomeDto somedto = new SomeDto()
somedto.setGood(false) //sets the value to false - should have been setIsGood
somedto.isGood() //return false - should have been getIsGood

Also when I make a request on the endpoint where I use this DTO in the JSON returns:

{"good": false}

whereas is should has been :

{"isGood": false}

Anyone has any idea what the problem is? I have a suspicion that the "is" in the beginning of isGood creates maybe a confusion for lombok. I appreciate any help you can provide.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I guess the convention is that for a boolean, the getter is called isGood, while the setter is setGood. So your boolean is expected to be called just "good".

Here is one discussion

Also in the documentation :)

 lombok.getter.noIsPrefix = [true | false] (default: false)
    If set to true, getters generated for boolean fields will use the get prefix instead of the defaultis prefix, and any generated code that calls getters, such as @ToString, will also use get instead of is 

Docs

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!