It would be nice if you would implement overriding getter/setter annotations. For example:
@Getter
public class Example {
private int a;
public int getA() { //override to avoid npe
return a < 0 ? -1 : a;
}
}
Just do it. No getter gets generated if there's already one present.
You can also use @Getter(AccessLevel.NONE)
to disable the generation explicitly.
Well then it is an issue of IntelliJ IDEA plugin, which warns me that I cannot have @Getter
and simple getter together. Thank you for the answer!
AFAIK, there should be no such warning unless the annotation surely generates no getters at all (a field-level annotation together with the manual getter should produce a warning; a class-level annotation should not).
Most helpful comment
Just do it. No getter gets generated if there's already one present.
You can also use
@Getter(AccessLevel.NONE)
to disable the generation explicitly.