|
Lombok - v0.11.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value={FIELD,TYPE})
@Retention(value=SOURCE)
public @interface WitherPut on any field to make lombok build a 'wither' - a withX method which produces a clone of this object (except for 1 field which gets a new value).
Example:
private @Wither final int foo;
will generate:
public SELF_TYPE withFoo(int foo) {
return this.foo == foo ? this : new SELF_TYPE(otherField1, otherField2, foo);
}
If any method named withFoo (case insensitive) exists, regardless of return type or parameters,
no method is generated, and instead a compiler warning is emitted.
This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have
a Wither annotation have the annotation.
| Optional Element Summary | |
|---|---|
AccessLevel |
value
If you want your wither to be non-public, you can specify an alternate access level here. |
public abstract AccessLevel value
|
Lombok - v0.11.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||