Class CorePreconditions
- java.lang.Object
-
- com.playernguyen.playernguyencore.utils.CorePreconditions
-
public class CorePreconditions extends java.lang.Object
Preconditions util class to check the condition state of variables, functions,...
This class likely Guava Precondition (I don't know which version from Spigot, Bukkit support this)
-
-
Constructor Summary
Constructors Constructor Description CorePreconditions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
argument(boolean express)
Check argument expressstatic void
argument(boolean express, java.lang.String message)
Check argument express with message.static <T> void
notNull(T which)
Check not null to template classstatic <T> void
notNull(T which, java.lang.String message)
Check not null to template class.static void
state(boolean express)
Check state is legit with boolean express.static void
state(boolean express, java.lang.String message)
Check state is legit with boolean express.
-
-
-
Method Detail
-
notNull
public static <T> void notNull(T which, java.lang.String message)
Check not null to template class.- Type Parameters:
T
- Template object to check not null- Parameters:
which
- The object to check not nullmessage
- The message ofNullPointerException
catch
-
notNull
public static <T> void notNull(T which)
Check not null to template class- Type Parameters:
T
- Template object to check not null- Parameters:
which
- The object to check not null
-
argument
public static void argument(boolean express)
Check argument express- Parameters:
express
- The boolean express of that arguments- Throws:
java.lang.IllegalArgumentException
- When the express is wrong
-
argument
public static void argument(boolean express, java.lang.String message)
Check argument express with message.- Parameters:
express
- The boolean express of that argumentsmessage
- The message will send toIllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
- When the express is wrong
-
state
public static void state(boolean express, java.lang.String message)
Check state is legit with boolean express.- Parameters:
express
- The boolean expressmessage
- The message will sendIllegalStateException
- Throws:
java.lang.IllegalStateException
- When the express is wrong
-
state
public static void state(boolean express)
Check state is legit with boolean express.- Parameters:
express
- The boolean express- Throws:
java.lang.IllegalStateException
- When the express is wrong
-
-