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 voidcheckArgument(boolean condition, Object argument)static voidcheckArgument(boolean condition, String message)static voidcheckArgumentNotNull(Object reference)ThrowsIllegalArgumentExceptionif the reference is null.static voidcheckArgumentNotNull(Object reference, String argumentName)ThrowsIllegalArgumentExceptionwith an appropriate message if the reference is null.static voidcheckNotNull(Object reference)
-
-
-
Method Detail
-
checkArgumentNotNull
public static void checkArgumentNotNull(Object reference, String argumentName)
ThrowsIllegalArgumentExceptionwith 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)
ThrowsIllegalArgumentExceptionif 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)
-
-