Lombok annotation @Getter for boolean field

Read the ‘small print’ section on the lombok page https://projectlombok.org/features/GetterSetter.html

For boolean fields that start with is immediately followed by a
title-case letter, nothing is prefixed to generate the getter name.

So the behavior you experience is as specified.

Note that the behavior is different for boolean and Boolean:

private boolean isGood; // => isGood()

private boolean good; // => isGood()

private Boolean isGood; // => getIsGood()

Leave a Comment