Package org.junit.internal
Class Checks
- java.lang.Object
-
- org.junit.internal.Checks
-
public final class Checks extends java.lang.Object
- Since:
- 4.13
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Checks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
notNull(T value)
Checks that the given value is notnull
.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.
-
-
-
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
- ifvalue
isnull
-
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 ifvalue
isnull
- Returns:
- the passed-in value, if not
null
- Throws:
java.lang.NullPointerException
- ifvalue
isnull
-
-