Gradle deprecated annotation processor warnings for lombok

Change the lombok dependency type from compile to annotationProcessor, so your dependencies section in your build.gradle file should look like: dependencies { compileOnly(‘org.projectlombok:lombok:1.16.20’) annotationProcessor ‘org.projectlombok:lombok:1.16.20’ // compile ‘org.projectlombok:lombok:1.16.20’ <– this no longer works! // other dependencies… }

How to implements Lombok @Builder for Abstract class

This is possible with lombok 1.18.2 (and above) using the new (experimental) annotation @SuperBuilder. The only restriction is that every class in the hierarchy must have the @SuperBuilder annotation. There is no way around putting @SuperBuilder on all subclasses, because Lombok cannot know all subclasses at compile time. See the lombok documentation for details. Example: … Read more

@JsonIgnore with @Getter Annotation

To put the @JsonIgnore to the generated getter method, you can use onMethod = @__( @JsonIgnore ). This will generate the getter with the specific annotation. For more details check http://projectlombok.org/features/GetterSetter.html @Getter @Setter public class User { private userName; @Getter(onMethod = @__( @JsonIgnore )) @Setter private password; }

Is it possible to make Lombok’s builder public?

@Builder already produces public methods, it’s just the constructor that’s package-private. The reason is that they intend for you to use the static builder() method, which is public, instead of using the constructor directly: Foo foo = Foo.builder() .property(“hello, world”) .build(); If you really, really, really want the constructor to be public (there seems to … Read more

Lombok builder to check non null and not empty

Maxim Kirilov’s answer is incomplete. It doesn’t check for blank/empty Strings. I’ve faced the same issue before, and I realized that in addition to using @NonNull and @Builder from Lombok, overload the constructor with a private access modifier, where you can perform the validations. Something like this: private Person(final String firstName, final String lastName) { … Read more

Initialize list if list is null with lombok getter?

You can achieve this by declaring and initializing the fields. The initialization will be done when the enclosing object is initialized. private List<Object> list = new ArrayList(); Lomboks @Getter annotation provides an attribute lazy which allows lazy initialization. @Getter(lazy=true) private final double[] cached = expensiveInitMethod(); Documentation

Lombok Maven javadoc:aggregate report with generated sources

I created a workaround build configuration that will create aggregated javadocs from generated sources, although the call sequence has two steps: mvn package mvn -N pre-site The build configuration is now published in Github. The current version only supports a project tree of depth one, but can of course be modified. It works by gathering … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)