Lombok: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
<source lang="java"> | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
public class MyPojo { | |||
@Getter(AccessLevel.NONE) | |||
private Boolean xxx; | |||
public Boolean hasXxx() { | |||
return xxx; | |||
} | |||
} | |||
</source> | |||
==References== | ==References== | ||
* [https://stackoverflow.com/questions/18139678/ Lombok customise getter for Boolean object field] | * [https://stackoverflow.com/questions/18139678/ Lombok customise getter for Boolean object field] | ||
* [https://objectcomputing.com/resources/publications/sett/january-2010-reducing-boilerplate-code-with-project-lombok Reducing Boilerplate Code with Project Lombok] | * [https://objectcomputing.com/resources/publications/sett/january-2010-reducing-boilerplate-code-with-project-lombok Reducing Boilerplate Code with Project Lombok] | ||
* [https://projectlombok.org/ Project Lombok] | * [https://projectlombok.org/ Project Lombok] |
Revision as of 17:27, 5 August 2021
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MyPojo {
@Getter(AccessLevel.NONE)
private Boolean xxx;
public Boolean hasXxx() {
return xxx;
}
}