how to generate getter??
example :
private String something;
public String getSomething(){
return something==null?"":something;
}
This is not generatable atm. Lombok only provides support to shorten simple getters wth the @Getter annotation.
Also I think the code you have should just deal with nulls instead of empty strings, but thats another topic.
In the light of the recent thoughts on onNull, and the niceties of a getOrDefault kind of construct, this could be a feature request for a default-value parameter on @Getter.
However, since annotation parameters can't be ordinary Objects, the closest one could reasonably get would be to rewrite @Getter(defaultValue="42") Integer foo; to return this.foo == null ? Integer.valueOf("42") : this.foo;.
Most helpful comment
This is not generatable atm. Lombok only provides support to shorten simple getters wth the
@Getterannotation.Also I think the code you have should just deal with nulls instead of empty strings, but thats another topic.