Given class is used in 2 projects of mine.
- The first project is web app developed in Java 17 with Eclipse STS
4.22.0
. - The other project is Android app developed in Java 8 with Android Studio
Hedgehog | 2023.1.1 Patch 2
.
Both projects are using Lombok which works fine in Eclipse STS and partially in Android Studio.
The feature which does not work in Android Studio is overriding builder methods.
The error I get with Android Studio on each method of my override class:
Method does not override method from its superclass
Also when I hover class name SearchReqBuilder
, I get:
Class ‘SearchReqBuilder’ is never used
The version of Lombok used with Eclipse STS is 1.18.32
whilebundled 231.9011.34
is used with Android Studio.
What am I doing wrong?
The question:
Is there a way to tell Android Studio to override builder class?
P.S.
Things that I already tried:
- explicit builder class name:
@Builder( builderClassName = "SearchReqBuilder" )
- explicit different builder class name:
@Builder( builderClassName = "Jenny" )
@Builder @Getter @ToString
public class SearchReq implements Serializable {
private static final long serialVersionUID = 7725557429791727801L;
private final String q;
private final Integer categoryId;
private final Integer cityId;
private final CustomCache.Key cacheKey;
private final Integer cacheId;
public static class SearchReqBuilder {
@Override public SearchReqBuilder categoryId( final Integer id ) {
this.categoryId = id;
this.cacheId = id;
return this;
}
@Override public SearchReqBuilder cityId( final Integer id ) {
this.cityId = id;
this.cacheId = id;
return this;
}
}
}