From 782daa49979c35cd93139b3cfbc98eafe346f790 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot @RequiredArgsConstructor
together: In other words, @Data
generates all the
boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields, setters for all non-final fields,
and appropriate toString
, equals
and hashCode
implementations that involve the fields of the class, and a constructor that
- initializes all final fields, as well as all non-final fields with no initializer that have been marked with @NonNull
or @NotNull
,
+ initializes all final fields, as well as all non-final fields with no initializer that have been marked with @NonNull
,
in order to ensure the field is never null.
@Data
is like having implicit @Getter
, @Setter
, @ToString
, @EqualsAndHashCode
and @RequiredArgsConstructor
diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html
index 51a1f514..3e3530ef 100644
--- a/website/features/GetterSetter.html
+++ b/website/features/GetterSetter.html
@@ -58,7 +58,7 @@
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
or @NotNull
(case insensitive) on the field are interpreted as: This field must not ever hold
+ 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.
-- cgit