From d0116a8efe58c608b2001855d0cde92392ae9ca2 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot @Data
is smart enough to defer to those annotations.
All generated getters and setters will be public
. To override the access level, annotate the field with an explicit @Setter
and/or
- @Getter
annotation.
+ @Getter
annotation. You can also use this annotation (by combining it with AccessLevel.NONE
) to suppress generating a getter and/or setter
+ altogether.
All fields marked as transient
will not be considered for hashCode
and equals
. All static fields will be
skipped entirely (not considered for any of the generated methods, and no setter/getter will be made for them).
diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html
index 27bafc70..5b70aaf4 100644
--- a/website/features/GetterSetter.html
+++ b/website/features/GetterSetter.html
@@ -55,6 +55,9 @@
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
) are copied to setter parameter and getter method
+
+ Using the AccessLevel.NONE
access level simply generates nothing. It's useful only in combination with
+ @Data
.