From 52582dc10ea1b5ea4a1dbb71831a442056354990 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 28 Dec 2010 16:50:19 +0100 Subject: @ToString, @Getter, and @XArgsConstructor now work on, and are legal on, enums. Docs have been updated. Behaviour of @XArgsConstructor when its placement makes no sense (i.e. when annotating an interface with them) is no longer 'throw weird errors', but has been brought in line with the others: A nice error message is generated. Fixes issue #175 --- website/features/Constructor.html | 3 +++ website/features/GetterSetter.html | 3 +++ website/features/ToString.html | 2 ++ 3 files changed, 8 insertions(+) (limited to 'website') diff --git a/website/features/Constructor.html b/website/features/Constructor.html index 6a7cfd2f..072e46ed 100644 --- a/website/features/Constructor.html +++ b/website/features/Constructor.html @@ -68,6 +68,9 @@ The @java.beans.ConstructorProperties annotation is never generated for a constructor with no arguments. This also explains why @NoArgsConstructor lacks the suppressConstructorProperties annotation method. The @ConstructorProperties annotation is also omitted for private constructors. The generated static factory methods also do not get @ConstructorProperties, as this annotation can only be added to real constructors. +

+ @XArgsConstructor can also be used on an enum definition. The generated constructor will always be + private, because non-private constructors aren't legal in enums. You don't have to specify AccessLevel.PRIVATE.

diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html index fd4ed17d..8e7a1ede 100644 --- a/website/features/GetterSetter.html +++ b/website/features/GetterSetter.html @@ -67,6 +67,9 @@

Using the AccessLevel.NONE access level simply generates nothing. It's useful only in combination with @Data or a class-wide @Getter or @Setter. +

+ @Getter can also be used on enums. @Setter can't, not for a technical reason, but + for a pragmatic one: Setters on enums are an extremely bad idea.

diff --git a/website/features/ToString.html b/website/features/ToString.html index e350c265..8ac29bb1 100644 --- a/website/features/ToString.html +++ b/website/features/ToString.html @@ -62,6 +62,8 @@

If a getter exists for a field to be included, it is called instead of using a direct field reference. This behaviour can be suppressed:
@ToString(doNotUseGetters = true) +

+ @ToString can also be used on an enum definition.

-- cgit