| Package | Description |
|---|---|
| com.github.peiatgithub.java.utils |
| Modifier and Type | Method and Description |
|---|---|
static Throwable |
Utils.catchThrowable(NonArgFunction function)
Simplify the codes to catch an unchecked exception, usually the RuntimeException.
|
static void |
Utils.ifElse(boolean flag,
NonArgFunction fnc1,
NonArgFunction fnc2)
If flag is true, run function1, else, run function2
Simplify the usually 5 lines code to one line
|
static void |
Utils.ifNotNull(Object obj,
NonArgFunction fnc)
If obj is not null, run fnc.
|
static void |
Utils.ifThen(boolean flag,
NonArgFunction fnc)
If flag is true, run function.
|
static void |
Utils.repeatRun(int times,
NonArgFunction function)
Simplifies the code to repeatedly run a piece of code for N times.
|
Copyright © 2018. All rights reserved.