aboutsummaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-02-02 04:47:21 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-02-02 04:52:20 +0100
commitd8da2b9438056e945ecc38d98fed413444c847b3 (patch)
tree6d421923faaaf8566a7f827f3a803513c96c602b /website
parent46ce592dff458a0561fed900c0659bccb1755a1a (diff)
downloadlombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.gz
lombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.bz2
lombok-d8da2b9438056e945ecc38d98fed413444c847b3.zip
added impl for @UtilityClass.
Diffstat (limited to 'website')
-rw-r--r--website/features/experimental/UtilityClass.html80
-rw-r--r--website/features/experimental/index.html2
-rw-r--r--website/features/experimental/onX.html2
3 files changed, 83 insertions, 1 deletions
diff --git a/website/features/experimental/UtilityClass.html b/website/features/experimental/UtilityClass.html
new file mode 100644
index 00000000..5526ec77
--- /dev/null
+++ b/website/features/experimental/UtilityClass.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="../../logi/reset.css" />
+ <link rel="stylesheet" type="text/css" href="../features.css" />
+ <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" />
+ <meta name="description" content="Spice up your java" />
+ <title>@UtilityClass</title>
+</head><body><div id="pepper">
+ <div class="minimumHeight"></div>
+ <div class="meat">
+ <div class="header"><a href="../../index.html">Project Lombok</a></div>
+ <h1>@UtilityClass</h1>
+ <div class="byline">Utility, metility, wetility! Utility classes for the masses.</div>
+ <div class="since">
+ <h3>Since</h3>
+ <p>
+ <code>@UtilityClass</code> was introduced as an experimental feature in lombok v1.16.2.
+ </p>
+ </div>
+ <div class="experimental">
+ <h3>Experimental</h3>
+ <p>
+ Experimental because:
+ <ul>
+ <li>Some debate as to whether its common enough to count as boilerplate.</li>
+ </ul>
+ Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon.
+ </div>
+ <div class="overview">
+ <h3>Overview</h3>
+ <p>
+ A utility class is a class that is just a namespace for functions. No instances of it can exist, and all its members
+ are static. For example, <code>java.lang.Math</code> and <code>java.util.Collections</code> are well known utility classes. This annotation automatically turns the annotated class into one.
+ </p><p>
+ A utility class cannot be instantiated. By marking your class with <code>@UtilityClass</code>, lombok will automatically
+ generate a private constructor that throws an exception, flags as error any explicit constructors you add, and marks
+ the class <code>final</code>. If the class is an inner class, the class is also marked <code>static</code>.
+ </p><p>
+ <em>All</em> members of a utility class are automatically marked as <code>static</code>. Even fields and inner classes.
+ </p>
+ </div>
+ <div class="snippets">
+ <div class="pre">
+ <h3>With Lombok</h3>
+ <div class="snippet">@HTML_PRE@</div>
+ </div>
+ <div class="sep"></div>
+ <div class="post">
+ <h3>Vanilla Java</h3>
+ <div class="snippet">@HTML_POST@</div>
+ </div>
+ </div>
+ <div style="clear: left;"></div>
+ <div class="overview">
+ <h3>Small print</h3><div class="smallprint">
+ <p>
+ There isn't currently any way to create non-static members, or to define your own constructor. If you want to instantiate
+ the utility class, even only as an internal implementation detail, <code>@UtilityClass</code> cannot be used.
+ </p>
+ </div>
+ </div>
+ <div class="footer">
+ <a href="index.html">Back to experimental features</a> | <a href="onX.html">Previous feature (onX)</a> | <span class="disabled">Next feature</span><br />
+ <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright &copy; 2009-2015 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span>
+ </div>
+ <div style="clear: both;"></div>
+ </div>
+</div>
+<script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-9884254-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+</script>
+</body></html>
diff --git a/website/features/experimental/index.html b/website/features/experimental/index.html
index a5932b73..3f2d2802 100644
--- a/website/features/experimental/index.html
+++ b/website/features/experimental/index.html
@@ -34,6 +34,8 @@
<dd>Immutable 'setters' - methods that create a clone but with one changed field.</dd>
<dt><a href="onX.html"><code>onMethod= / onConstructor= / onParam=</code></a></dt>
<dd>Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating.</dd>
+ <dt><a href="UtilityClass.html"><code>@UtilityClass</code></a></dt>
+ <dd>Utility, metility, wetility! Utility classes for the masses.</dd>
</dl>
</div>
<div class="overview confKeys">
diff --git a/website/features/experimental/onX.html b/website/features/experimental/onX.html
index 064db557..ced78dff 100644
--- a/website/features/experimental/onX.html
+++ b/website/features/experimental/onX.html
@@ -69,7 +69,7 @@
</div>
</div>
<div class="footer">
- <a href="index.html">Back to experimental features</a> | <a href="Wither.html">Previous feature (@Wither)</a> | <span class="disabled">Next feature</span><br />
+ <a href="index.html">Back to experimental features</a> | <a href="Wither.html">Previous feature (@Wither)</a> | <a href="UtilityClass.html">Next feature (@UtilityClass)</a><br />
<a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright &copy; 2009-2015 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span>
</div>
<div style="clear: both;"></div>