Package org.jboss.weld.util
Class Preconditions
- java.lang.Object
-
- org.jboss.weld.util.Preconditions
-
public class Preconditions extends Object
- Author:
- Jozef Hartinger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkArgument(boolean condition, Object argument)
static void
checkArgument(boolean condition, String message)
static void
checkArgumentNotNull(Object reference)
ThrowsIllegalArgumentException
if the reference is null.static void
checkArgumentNotNull(Object reference, String argumentName)
ThrowsIllegalArgumentException
with an appropriate message if the reference is null.static void
checkNotNull(Object reference)
-
-
-
Method Detail
-
checkArgumentNotNull
public static void checkArgumentNotNull(Object reference, String argumentName)
ThrowsIllegalArgumentException
with an appropriate message if the reference is null.- Parameters:
reference
- the reference to be checkedargumentName
- name of the argument that is being checked. The name used in the error message.
-
checkArgumentNotNull
public static void checkArgumentNotNull(Object reference)
ThrowsIllegalArgumentException
if the reference is null. This method should only be used for methods with single argument.- Parameters:
reference
- the reference to be checked
-
checkNotNull
public static void checkNotNull(Object reference)
- Parameters:
reference
- The reference to be checked- Throws:
NullPointerException
- if the reference is null
-
checkArgument
public static void checkArgument(boolean condition, Object argument)
-
checkArgument
public static void checkArgument(boolean condition, String message)
-
-