From aee4e76d864e01b5d453409e703ad54852fa57bb Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot
Any variation on boolean
will not result in using the is
prefix instead of the get
prefix; for example, returning java.lang.Boolean
results in a get
prefix, not an is
prefix.
- Any annotations named @NonNull
(case insensitive) on the field are interpreted as: This field must not ever hold null. Therefore, these annotations result in an explicit null check in the generated setter. Also, these annotations (as well as any annotation named @Nullable
or @CheckForNull
) are copied to setter parameter and getter method.
+ A number of annotations from popular libraries that indicate non-nullness, such as javax.annotation.Nonnull
, if present on the field, result in an explicit null check in the generated setter.
+
+ Various well-known annotations about nullability, such as org.eclipse.jdt.annotation.NonNull
, are automatically copied over to the right place (method for getters, parameter for setters). You can specify additional annotations that should always be copied via lombok configuration key lombok.copyableAnnotations
.
You can annotate a class with a @Getter
or @Setter
annotation. Doing so is equivalent to annotating all non-static fields in that class with that annotation. @Getter
/@Setter
annotations on fields take precedence over the ones on classes.
-- cgit