mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 12:14:31 +00:00
fixed ExtensionMethod example to return T (generic type) , seem to remove or forgot for some reason...
This commit is contained in:
1 parent
5a5d75a931
commit
57b66fd576
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