diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-06-01 11:02:18 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-06-01 11:02:18 +0200 |
commit | f8b3056dc4f61251aba7adf627c942c85e8618ca (patch) | |
tree | 8f58fc4d57d53cb791d027881fb8b8dd9cef11a1 /website/features/ToString.html | |
parent | 627de194c03af3afa3478149dc777d2af4e9654b (diff) | |
download | lombok-f8b3056dc4f61251aba7adf627c942c85e8618ca.tar.gz lombok-f8b3056dc4f61251aba7adf627c942c85e8618ca.tar.bz2 lombok-f8b3056dc4f61251aba7adf627c942c85e8618ca.zip |
Fixed up and extended Tolerate with support for constructors, and added docs.
Diffstat (limited to 'website/features/ToString.html')
-rw-r--r-- | website/features/ToString.html | 16 |
1 files changed, 5 insertions, 11 deletions
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 @@ <div class="overview"> <h3>Overview</h3> <p> - Any class definition may be annotated with <code>@ToString</code> to let lombok generate an implementation of the - <code>toString()</code> 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 <code>@ToString</code> to let lombok generate an implementation of the <code>toString()</code> method. By default, it'll print your class name, along with each field, in order, separated by commas. </p><p> - By setting the <code>includeFieldNames</code> parameter to <em>true</em> you can add some clarity (but also quite some length) to - the output of the <code>toString()</code> method. + By setting the <code>includeFieldNames</code> parameter to <em>true</em> you can add some clarity (but also quite some length) to the output of the <code>toString()</code> method. </p><p> - By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the <code>exclude</code> 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 <code>of</code> parameter. + By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the <code>exclude</code> 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 <code>of</code> parameter. </p><p> - By setting <code>callSuper</code> to <em>true</em>, you can include the output of the superclass implementation of <code>toString</code> to the - output. Be aware that the default implementation of <code>toString()</code> in <code>java.lang.Object</code> is pretty much meaningless, so you - probably don't want to do this unless you are extending another class. + By setting <code>callSuper</code> to <em>true</em>, you can include the output of the superclass implementation of <code>toString</code> to the output. Be aware that the default implementation of <code>toString()</code> in <code>java.lang.Object</code> is pretty much meaningless, so you probably don't want to do this unless you are extending another class. </p> </div> <div class="snippets"> @@ -55,8 +50,7 @@ <div class="overview"> <h3>Small print</h3><div class="smallprint"> <p> - If there is <em>any</em> method named <code>toString</code> regardless of parameters or return type, no method will be generated, and instead - a warning is emitted explaining that your <code>@ToString</code> annotation is doing nothing. + If there is <em>any</em> method named <code>toString</code> with no arguments, regardless of return type, no method will be generated, and instead a warning is emitted explaining that your <code>@ToString</code> annotation is doing nothing. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. </p><p> Arrays are printed via <code>Arrays.deepToString</code>, which means that arrays that contain themselves will result in <code>StackOverflowError</code>s. However, this behaviour is no different from e.g. <code>ArrayList</code>. |