|
Lombok - v0.10.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlombok.Lombok
public class Lombok
Useful utility methods to manipulate lombok-generated code.
| Constructor Summary | |
|---|---|
Lombok()
|
|
| Method Summary | ||
|---|---|---|
static
|
preventNullAnalysis(T value)
Returns the parameter directly. |
|
static RuntimeException |
sneakyThrow(Throwable t)
Throws any throwable 'sneakily' - you don't need to catch it, nor declare that you throw it onwards. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Lombok()
| Method Detail |
|---|
public static RuntimeException sneakyThrow(Throwable t)
Example usage:
public void run() {
throw sneakyThrow(new IOException("You don't need to catch me!"));
}
NB: The exception is not wrapped, ignored, swallowed, or redefined. The JVM actually does not know or care about the concept of a 'checked exception'. All this method does is hide the act of throwing a checked exception from the java compiler.
Note that this method has a return type of RuntimeException; it is advised you always call this
method as argument to the throw statement to avoid compiler errors regarding no return
statement and similar problems. This method won't of course return an actual RuntimeException -
it never returns, it always throws the provided exception.
t - The throwable to throw without requiring you to catch its type.
public static <T> T preventNullAnalysis(T value)
T - the type of the parametervalue - the value to return
|
Lombok - v0.10.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||