1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import lombok.Delegate; import lombok.Getter; class DelegateOnGetter { @Delegate @Getter(lazy=true) private final Bar bar = new Bar() { public void setList(java.util.ArrayList<String> list) { } public int getInt() { return 42; } }; private interface Bar { void setList(java.util.ArrayList<java.lang.String> list); int getInt(); } }