mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +00:00
Merge pull request #1622 from danieltaub96/master
fixed ExtensionMethod example to return T (generic type)
This commit is contained in:
1 file changed
+1
-1
@@ -36,7 +36,7 @@
|
||||
</p><p>
|
||||
Lombok does not (currently) have any runtime dependencies which means lombok does not (currently) ship with any useful extension methods so you'll have to make your own. However, here's one that might spark your imagination: <br />
|
||||
<pre>public class ObjectExtensions {
|
||||
public static <T> or(T object, T ifNull) {
|
||||
public static <T> T or(T object, T ifNull) {
|
||||
return object != null ? object : ifNull;
|
||||
}
|
||||
}</pre><br />
|
||||
|
||||
Reference in new issue
Block a user