Package org.nd4j.common.base
Class Preconditions
- java.lang.Object
-
- org.nd4j.common.base.Preconditions
-
public final class Preconditions extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckArgument(boolean b)Check the specified boolean argument.static voidcheckArgument(boolean b, String message)Check the specified boolean argument.static voidcheckArgument(boolean b, String msg, double arg1)static voidcheckArgument(boolean b, String msg, double arg1, double arg2)static voidcheckArgument(boolean b, String msg, double arg1, double arg2, double arg3)static voidcheckArgument(boolean b, String msg, double arg1, double arg2, double arg3, double arg4)static voidcheckArgument(boolean b, String msg, int arg1)static voidcheckArgument(boolean b, String msg, int arg1, int arg2)static voidcheckArgument(boolean b, String msg, int arg1, int arg2, int arg3)static voidcheckArgument(boolean b, String msg, int arg1, int arg2, int arg3, int arg4)static voidcheckArgument(boolean b, String msg, long arg1)static voidcheckArgument(boolean b, String msg, long arg1, long arg2)static voidcheckArgument(boolean b, String msg, long arg1, long arg2, long arg3)static voidcheckArgument(boolean b, String msg, long arg1, long arg2, long arg3, long arg4)static voidcheckArgument(boolean b, String msg, Object arg1)static voidcheckArgument(boolean b, String message, Object... args)Check the specified boolean argument.static voidcheckArgument(boolean b, String msg, Object arg1, Object arg2)static voidcheckArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3)static voidcheckArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4)static voidcheckArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)static voidcheckArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)static voidcheckNotNull(Object o)Check the specified boolean argument.static voidcheckNotNull(Object o, String message)Check the specified boolean argument.static voidcheckNotNull(Object o, String msg, double arg1)static voidcheckNotNull(Object o, String msg, double arg1, double arg2)static voidcheckNotNull(Object o, String msg, double arg1, double arg2, double arg3)static voidcheckNotNull(Object o, String msg, double arg1, double arg2, double arg3, double arg4)static voidcheckNotNull(Object o, String msg, int arg1)static voidcheckNotNull(Object o, String msg, int arg1, int arg2)static voidcheckNotNull(Object o, String msg, int arg1, int arg2, int arg3)static voidcheckNotNull(Object o, String msg, int arg1, int arg2, int arg3, int arg4)static voidcheckNotNull(Object o, String msg, long arg1)static voidcheckNotNull(Object o, String msg, long arg1, long arg2)static voidcheckNotNull(Object o, String msg, long arg1, long arg2, long arg3)static voidcheckNotNull(Object o, String msg, long arg1, long arg2, long arg3, long arg4)static voidcheckNotNull(Object o, String msg, Object arg1)static voidcheckNotNull(Object o, String message, Object... args)Check the specified boolean argument.static voidcheckNotNull(Object o, String msg, Object arg1, Object arg2)static voidcheckNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3)static voidcheckNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3, Object arg4)static voidcheckState(boolean b)Check the specified boolean argument.static voidcheckState(boolean b, String message)Check the specified boolean argument.static voidcheckState(boolean b, String msg, double arg1)static voidcheckState(boolean b, String msg, double arg1, double arg2)static voidcheckState(boolean b, String msg, double arg1, double arg2, double arg3)static voidcheckState(boolean b, String msg, double arg1, double arg2, double arg3, double arg4)static voidcheckState(boolean b, String msg, int arg1)static voidcheckState(boolean b, String msg, int arg1, int arg2)static voidcheckState(boolean b, String msg, int arg1, int arg2, int arg3)static voidcheckState(boolean b, String msg, int arg1, int arg2, int arg3, int arg4)static voidcheckState(boolean b, String msg, long arg1)static voidcheckState(boolean b, String msg, long arg1, long arg2)static voidcheckState(boolean b, String msg, long arg1, long arg2, long arg3)static voidcheckState(boolean b, String msg, long arg1, long arg2, long arg3, long arg4)static voidcheckState(boolean b, String msg, Object arg1)static voidcheckState(boolean b, String message, Object... args)Check the specified boolean argument.static voidcheckState(boolean b, String msg, Object arg1, Object arg2)static voidcheckState(boolean b, String msg, Object arg1, Object arg2, Object arg3)static voidcheckState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4)static voidcheckState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)static voidcheckState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)static StringformatArray(Object o)static voidthrowEx(String message, Object... args)static voidthrowNullPointerEx(String message, Object... args)static voidthrowStateEx(String message, Object... args)
-
-
-
Method Detail
-
checkArgument
public static void checkArgument(boolean b)
Check the specified boolean argument. Throws an IllegalArgumentException ifbis false- Parameters:
b- Argument to check
-
checkArgument
public static void checkArgument(boolean b, String message)Check the specified boolean argument. Throws an IllegalArgumentException with the specified message ifbis false- Parameters:
b- Argument to checkmessage- Message for exception. May be null
-
checkArgument
public static void checkArgument(boolean b, String msg, int arg1)
-
checkArgument
public static void checkArgument(boolean b, String msg, long arg1)
-
checkArgument
public static void checkArgument(boolean b, String msg, double arg1)
-
checkArgument
public static void checkArgument(boolean b, String msg, int arg1, int arg2)
-
checkArgument
public static void checkArgument(boolean b, String msg, long arg1, long arg2)
-
checkArgument
public static void checkArgument(boolean b, String msg, double arg1, double arg2)
-
checkArgument
public static void checkArgument(boolean b, String msg, int arg1, int arg2, int arg3)
-
checkArgument
public static void checkArgument(boolean b, String msg, long arg1, long arg2, long arg3)
-
checkArgument
public static void checkArgument(boolean b, String msg, double arg1, double arg2, double arg3)
-
checkArgument
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3)
-
checkArgument
public static void checkArgument(boolean b, String msg, int arg1, int arg2, int arg3, int arg4)
-
checkArgument
public static void checkArgument(boolean b, String msg, long arg1, long arg2, long arg3, long arg4)
-
checkArgument
public static void checkArgument(boolean b, String msg, double arg1, double arg2, double arg3, double arg4)
-
checkArgument
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
-
checkArgument
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
-
checkArgument
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
-
checkArgument
public static void checkArgument(boolean b, String message, Object... args)Check the specified boolean argument. Throws an IllegalArgumentException with the specified message ifbis false. Note that the message may specify argument locations using "%s" - for example,checkArgument(false, "Got %s values, expected %s", 3, "more"would throw an IllegalArgumentException with the message "Got 3 values, expected more"- Parameters:
b- Argument to checkmessage- Message for exception. May be null.args- Arguments to place in message
-
checkState
public static void checkState(boolean b)
Check the specified boolean argument. Throws an IllegalStateException ifbis false- Parameters:
b- State to check
-
checkState
public static void checkState(boolean b, String message)Check the specified boolean argument. Throws an IllegalStateException with the specified message ifbis false- Parameters:
b- State to checkmessage- Message for exception. May be null
-
checkState
public static void checkState(boolean b, String msg, int arg1)
-
checkState
public static void checkState(boolean b, String msg, long arg1)
-
checkState
public static void checkState(boolean b, String msg, double arg1)
-
checkState
public static void checkState(boolean b, String msg, int arg1, int arg2)
-
checkState
public static void checkState(boolean b, String msg, long arg1, long arg2)
-
checkState
public static void checkState(boolean b, String msg, double arg1, double arg2)
-
checkState
public static void checkState(boolean b, String msg, int arg1, int arg2, int arg3)
-
checkState
public static void checkState(boolean b, String msg, long arg1, long arg2, long arg3)
-
checkState
public static void checkState(boolean b, String msg, double arg1, double arg2, double arg3)
-
checkState
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3)
-
checkState
public static void checkState(boolean b, String msg, int arg1, int arg2, int arg3, int arg4)
-
checkState
public static void checkState(boolean b, String msg, long arg1, long arg2, long arg3, long arg4)
-
checkState
public static void checkState(boolean b, String msg, double arg1, double arg2, double arg3, double arg4)
-
checkState
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
-
checkState
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
-
checkState
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
-
checkState
public static void checkState(boolean b, String message, Object... args)Check the specified boolean argument. Throws an IllegalStateException with the specified message ifbis false. Note that the message may specify argument locations using "%s" - for example,checkArgument(false, "Got %s values, expected %s", 3, "more"would throw an IllegalStateException with the message "Got 3 values, expected more"- Parameters:
b- Argument to checkmessage- Message for exception. May be null.args- Arguments to place in message
-
checkNotNull
public static void checkNotNull(Object o)
Check the specified boolean argument. Throws an NullPointerException ifois false- Parameters:
o- Object to check
-
checkNotNull
public static void checkNotNull(Object o, String message)
Check the specified boolean argument. Throws an NullPointerException with the specified message ifois false- Parameters:
o- Object to checkmessage- Message for exception. May be null
-
checkNotNull
public static void checkNotNull(Object o, String msg, long arg1, long arg2, long arg3)
-
checkNotNull
public static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3)
-
checkNotNull
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3)
-
checkNotNull
public static void checkNotNull(Object o, String msg, int arg1, int arg2, int arg3, int arg4)
-
checkNotNull
public static void checkNotNull(Object o, String msg, long arg1, long arg2, long arg3, long arg4)
-
checkNotNull
public static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3, double arg4)
-
checkNotNull
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
-
checkNotNull
public static void checkNotNull(Object o, String message, Object... args)
Check the specified boolean argument. Throws an IllegalStateException with the specified message ifois false. Note that the message may specify argument locations using "%s" - for example,checkArgument(false, "Got %s values, expected %s", 3, "more"would throw an IllegalStateException with the message "Got 3 values, expected more"- Parameters:
o- Object to checkmessage- Message for exception. May be null.args- Arguments to place in message
-
-