From cb091204f4bfc7f9971fc296903f7bc2a163f085 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 1 Sep 2009 00:19:28 +0200 Subject: Fixed documentation, specifically: added eclipse help system fix to the changelog, and added some documentation on the special handling of @NonNull/@NotNull/@Nullable for Data and Getter/Setter on the website docs. --- website/features/Data.html | 9 ++++++++- website/features/GetterSetter.html | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'website') diff --git a/website/features/Data.html b/website/features/Data.html index 19eacdd8..9216d46e 100644 --- a/website/features/Data.html +++ b/website/features/Data.html @@ -22,7 +22,8 @@ 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. In addition, @Data generates a constructor that - initialized all final fields. + initializes all final fields, as well as all non-final fields with no initializer that have been marked with @NonNull or @NotNull, + in order to ensure the field is never null.

@Data is like having implicit @ToString and @EqualsAndHashCode annotations on the class. However, the parameters of @ToString and @EqualsAndHashCode (such as callSuper, includeFieldNames and @@ -62,6 +63,12 @@

Small print

See the small print of @ToString, @EqualsAndHashCode and @Getter / @Setter. +

+ Any annotations named @NonNull or @NotNull (case insensitive) on a field are interpreted as: This field must not ever hold + null. Therefore, these annotations result in an explicit null check in the generated constructor for the provided field. Also, these + annotations (as well as any annotation named @Nullable) are copied to the constructor parameter, in both the true constructor and + any static constructor. The same principle applies to generated getters and setters (see the documentation for @Getter / @Setter) +

-- cgit