mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 00:16:47 +00:00
Very minor typos in Data/GetterSetter, added an index page for the features overview, and increased transparancy on the pepper background.
This commit is contained in:
1 parent
3bfe8d2161
commit
642dad3f0c
6 files changed
+95
-31
No files matched your search
+19
-16
@@ -41,21 +41,6 @@
|
||||
instance. This way, javac will infer the variable name. Thus, by declaring like so: <code>@Data(staticConstructor="of") class Foo<T> { private T x;}</code>
|
||||
you can create new instances of <code>Foo</code> by writing: <code>Foo.of(5);</code> instead of having to write: <code>new Foo<Integer>(5);</code>.
|
||||
</p>
|
||||
<h3>Small print</h3><div class="smallprint">
|
||||
<p>
|
||||
Arrays are 'deep' compared/printed/hashCoded, 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>.
|
||||
</p><p>
|
||||
You may safely presume that the hashCode implementation used will not change between versions of lombok, however this guarantee is not set in stone;
|
||||
if there's a significant performance improvement to be gained from using an alternate hash algorithm, that will be substituted in a future version.
|
||||
</p><p>
|
||||
For a general idea of how lombok generated the <code>equals</code>, <code>hashCode</code>, and <code>toString</code> methods, check the example below.
|
||||
</p><p>
|
||||
For the purposes of equality, 2 <code>NaN</code> (not a number) values for floats and doubles are considered equal, eventhough 'NaN == NaN' would
|
||||
return false. This is analogous to <code>java.lang.Double</code>'s equals method, and is in fact required to ensure that comparing an object
|
||||
to an exact copy of itself returns <code>true</code> for equality.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="snippets">
|
||||
<div class="pre">
|
||||
@@ -68,8 +53,26 @@
|
||||
<div class="snippet">@HTML_POST@</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: left;"></div>
|
||||
<div class="overview">
|
||||
<h3>Small print</h3><div class="smallprint">
|
||||
<p>
|
||||
Arrays are 'deep' compared/printed/hashCoded, 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>.
|
||||
</p><p>
|
||||
You may safely presume that the hashCode implementation used will not change between versions of lombok, however this guarantee is not set in stone;
|
||||
if there's a significant performance improvement to be gained from using an alternate hash algorithm, that will be substituted in a future version.
|
||||
</p><p>
|
||||
For a general idea of how lombok generated the <code>equals</code>, <code>hashCode</code>, and <code>toString</code> methods, check the example after.
|
||||
</p><p>
|
||||
For the purposes of equality, 2 <code>NaN</code> (not a number) values for floats and doubles are considered equal, eventhough 'NaN == NaN' would
|
||||
return false. This is analogous to <code>java.lang.Double</code>'s equals method, and is in fact required to ensure that comparing an object
|
||||
to an exact copy of itself returns <code>true</code> for equality.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<a href="features.html">Back to features</a> | <a href="GetterSetter.html">Previous feature (@Getter / @Setter)</a> | <a href="Cleanup.html">Next feature (@Cleanup)</a><br />
|
||||
<a href="index.html">Back to features</a> | <a href="GetterSetter.html">Previous feature (@Getter / @Setter)</a> | <a href="Cleanup.html">Next feature (@Cleanup)</a><br />
|
||||
<span class="copyright">Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT licence</a>.</span>
|
||||
</footer>
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
@@ -20,9 +20,23 @@
|
||||
if the field's type is <code>boolean</code>). A default setter is named <code>setFoo</code> if the field is called <code>foo</code>, returns <code>void</code>,
|
||||
and takes 1 parameter of the same type as the field. It simply sets the field to this value.
|
||||
</p><p>
|
||||
The generated getter/setter method will be <code>public</code> unless you explicitly specify an <code>AccessLevel</code>, as shown in the example below.
|
||||
The generated getter/setter method will be <code>public</code> unless you explicitly specify an <code>AccessLevel</code>, as shown in the example above.
|
||||
Legal access levels are <code>PUBLIC</code>, <code>PROTECTED</code>, <code>PACKAGE</code>, and <code>PRIVATE</code>.
|
||||
</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>
|
||||
For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified.
|
||||
@@ -37,19 +51,8 @@
|
||||
</p>
|
||||
</div>
|
||||
</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>
|
||||
<footer>
|
||||
<a href="features.html">Back to features</a> | <span class="disabled">Previous feature</span> | <a href="Data.html">Next feature (@Data)</a><br />
|
||||
<a href="index.html">Back to features</a> | <span class="disabled">Previous feature</span> | <a href="Data.html">Next feature (@Data)</a><br />
|
||||
<span class="copyright">Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT licence</a>.</span>
|
||||
</footer>
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
@@ -33,8 +33,31 @@ h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.overview code {
|
||||
.index {
|
||||
font-size: 1.2em;
|
||||
margin: 64px 0px 32px 64px;
|
||||
}
|
||||
|
||||
.index dt {
|
||||
margin-top: 8px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.index dd {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.overview code {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.smallprint {
|
||||
font-size: 0.8em;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.smallprint code {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.snippets {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<!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>Lombok feature overview</title>
|
||||
<!--[if lt IE 7]><script type="text/javascript" src="logi/iepngfix_tilebg.js"></script><![endif]-->
|
||||
</head><body><div id="pepper">
|
||||
<div class="meat">
|
||||
<div class="minimumHeight"></div>
|
||||
<div class="header"><a href="../index.html">Project Lombok</a></div>
|
||||
<h1>Lombok features</h1>
|
||||
<div class="index overview">
|
||||
<dl>
|
||||
<dt><a href="GetterSetter.html"><code>@Getter</code> / <code>@Setter</code></a></dt>
|
||||
<dd>Never write <code>public int getFoo() {return foo;}</code> again.</dd>
|
||||
<dt><a href="Data.html"><code>@Data</code></a></dt>
|
||||
<dd>'struct' for java: Automatically generate <code>toString</code>, <code>hashCode</code>, <code>equals</code>, a constructor, and getters and setters
|
||||
from just the fields in your class.</dd>
|
||||
<dt><a href="Cleanup.html"><code>@Cleanup</code></a></dt>
|
||||
<dd>Automatic resource management: Call your <code>close()</code> methods safely with no hassle.</dd>
|
||||
<dt><a href="Synchronized.html"><code>@Synchronized</code></a></dt>
|
||||
<dd><code>synchronized</code> done right: Don't expose your locks.</dd>
|
||||
<dt><a href="SneakyThrows.html"><code>@SneakyThrows</code></a></dt>
|
||||
<dd>To boldly throw checked exceptions where no one has thrown them before!</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<footer>
|
||||
<span class="copyright">Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT licence</a>.</span>
|
||||
</footer>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
</div></body></html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |
@@ -18,7 +18,7 @@ body{
|
||||
}
|
||||
|
||||
code,kbd,tt{
|
||||
font-family:"Courier New", Courier, monospace;
|
||||
font-family: "Courier new", Courier;
|
||||
line-height:1;
|
||||
*line-height:1.5;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user