From f8b3056dc4f61251aba7adf627c942c85e8618ca Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 1 Jun 2014 11:02:18 +0200 Subject: Fixed up and extended Tolerate with support for constructors, and added docs. --- website/features/ToString.html | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'website/features/ToString.html') diff --git a/website/features/ToString.html b/website/features/ToString.html index 6cdd8453..57bbd0f0 100644 --- a/website/features/ToString.html +++ b/website/features/ToString.html @@ -15,18 +15,13 @@

Overview

- Any class definition may be annotated with @ToString to let lombok generate an implementation of the - toString() method. By default, it'll print your class name, along with each field, in order, separated by commas. + Any class definition may be annotated with @ToString to let lombok generate an implementation of the toString() method. By default, it'll print your class name, along with each field, in order, separated by commas.

- By setting the includeFieldNames parameter to true you can add some clarity (but also quite some length) to - the output of the toString() method. + By setting the includeFieldNames parameter to true you can add some clarity (but also quite some length) to the output of the toString() method.

- By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the exclude parameter; each named - field will not be printed at all. Alternatively, you can specify exactly which fields you wish to be used by naming them in the of parameter. + By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the exclude parameter; each named field will not be printed at all. Alternatively, you can specify exactly which fields you wish to be used by naming them in the of parameter.

- By setting callSuper to true, you can include the output of the superclass implementation of toString to the - output. Be aware that the default implementation of toString() in java.lang.Object is pretty much meaningless, so you - probably don't want to do this unless you are extending another class. + By setting callSuper to true, you can include the output of the superclass implementation of toString to the output. Be aware that the default implementation of toString() in java.lang.Object is pretty much meaningless, so you probably don't want to do this unless you are extending another class.

@@ -55,8 +50,7 @@

Small print

- If there is any method named toString regardless of parameters or return type, no method will be generated, and instead - a warning is emitted explaining that your @ToString annotation is doing nothing. + If there is any method named toString with no arguments, regardless of return type, no method will be generated, and instead a warning is emitted explaining that your @ToString annotation is doing nothing. You can mark any method with @lombok.experimental.Tolerate to hide them from lombok.

Arrays are printed via Arrays.deepToString, which means that arrays that contain themselves will result in StackOverflowErrors. However, this behaviour is no different from e.g. ArrayList. -- cgit