@Target(value={TYPE,FIELD}) @Retention(value=SOURCE) public @interface Accessors
Complete documentation is found at the project lombok features page for @Accessors.
Using this annotation does nothing by itself; an annotation that makes lombok generate getters, setters, or "with"-ers
such as Setter
or Data
is also required.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
chain
If true, setters return
this instead of void . |
boolean |
fluent
If true, accessors will be named after the field and not include a
get or set
prefix. |
boolean |
makeFinal
If true, generated accessors will be marked
final . |
String[] |
prefix
If present, only fields with any of the stated prefixes are given the getter/setter treatment.
|
public abstract boolean fluent
get
or set
prefix. If true and chain
is omitted, chain
defaults to true
.@With
; they always get a "with" prefix.fieldName()
, not for example setFieldName
).public abstract boolean chain
this
instead of void
.
default: false, unless fluent=true
, then default: truevoid
(no chaining).public abstract boolean makeFinal
final
.
default: falsefinal
.public abstract String[] prefix
fFieldName
, specify such prefixes here).Copyright © 2025. All rights reserved.