Let's take the following class with a static inner class.
@Getter
@Setter
public class Request {
private String contactUrl;
private Resources resources;
@Getter
@Setter
private static class Resources {
private String basketId;
private String customerId;
}
}
I need to access the basketId
from another class like this:
Request request = new Request();
request.getResources.setBasketId("5");
This won't compile unless I define the Resources
class as public
.
Is there any other way using Lombok accessing this field while keeping Resources
private?