@Target(value={FIELD,METHOD}) @Retention(value=SOURCE) public @interface Delegate
private @Delegate List<String> foo;will generate for example an
boolean add(String)
method, which contains: return foo.add(arg);
, as well as all other methods in List
.
All public instance methods of the field's type, as well as all public instance methods of all the field's type's superfields are delegated, except for all methods
that exist in Object
, the canEqual(Object)
method, and any methods that appear in types
that are listed in the excludes
property.
Complete documentation is found at the project lombok features page for @Delegate.
public abstract Class<?>[] types
Object
, as well as canEqual(Object other)
will never be delegated.java.lang.Object
) in these types, generate a delegate method.public abstract Class<?>[] excludes
Object
, as well as canEqual(Object other)
will never be delegated.java.lang.Object
) in these types, skip generating a delegate method (overrides types()
).Copyright © 2024. All rights reserved.