Package org.junit.internal
Class Checks
- java.lang.Object
-
- org.junit.internal.Checks
-
public final class Checks extends java.lang.Object- Since:
- 4.13
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TnotNull(T value)Checks that the given value is notnull.static <T> TnotNull(T value, java.lang.String message)Checks that the given value is notnull, using the given message as the exception message if an exception is thrown.
-
-
-
Method Detail
-
notNull
public static <T> T notNull(T value)
Checks that the given value is notnull.- Parameters:
value- object reference to check- Returns:
- the passed-in value, if not
null - Throws:
java.lang.NullPointerException- ifvalueisnull
-
notNull
public static <T> T notNull(T value, java.lang.String message)Checks that the given value is notnull, using the given message as the exception message if an exception is thrown.- Parameters:
value- object reference to checkmessage- message to use ifvalueisnull- Returns:
- the passed-in value, if not
null - Throws:
java.lang.NullPointerException- ifvalueisnull
-
-