Package org.smooks.assertion
Class AssertArgument
- java.lang.Object
-
- org.smooks.assertion.AssertArgument
-
public abstract class AssertArgument extends Object
Argument assertion utilities.- Author:
- tfennelly
-
-
Constructor Summary
Constructors Constructor Description AssertArgument()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
isInstanceOf(Object arg, Class<?> clazz, String argName)
Assert that the argument is an instance of the specified class.static void
isNotEmpty(String arg, String argName)
Assert that the argument is not empty.static void
isNotNull(Object arg, String argName)
Assert that the argument is not null.static void
isNotNullAndNotEmpty(Object[] arg, String argName)
Assert that the argument is neither null nor empty.static void
isNotNullAndNotEmpty(String arg, String argName)
Assert that the argument is neither null nor empty.static void
isNotNullAndNotEmpty(Collection<?> arg, String argName)
Assert that the argument is neither null nor empty.static void
isNotNullAndNotEmpty(Map<?,?> arg, String argName)
Assert that the argument is neither null nor empty.
-
-
-
Method Detail
-
isNotNull
public static void isNotNull(Object arg, String argName) throws IllegalArgumentException
Assert that the argument is not null.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null.
-
isNotEmpty
public static void isNotEmpty(String arg, String argName) throws IllegalArgumentException
Assert that the argument is not empty.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is not null, but is empty.
-
isNotNullAndNotEmpty
public static void isNotNullAndNotEmpty(String arg, String argName) throws IllegalArgumentException
Assert that the argument is neither null nor empty.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null or empty.
-
isNotNullAndNotEmpty
public static void isNotNullAndNotEmpty(Object[] arg, String argName) throws IllegalArgumentException
Assert that the argument is neither null nor empty.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null or empty.
-
isNotNullAndNotEmpty
public static void isNotNullAndNotEmpty(Collection<?> arg, String argName) throws IllegalArgumentException
Assert that the argument is neither null nor empty.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null or empty.
-
isNotNullAndNotEmpty
public static void isNotNullAndNotEmpty(Map<?,?> arg, String argName) throws IllegalArgumentException
Assert that the argument is neither null nor empty.- Parameters:
arg
- Argument.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null or empty.
-
isInstanceOf
public static void isInstanceOf(Object arg, Class<?> clazz, String argName) throws IllegalArgumentException
Assert that the argument is an instance of the specified class.- Parameters:
arg
- Argument.clazz
- The Class type to check.argName
- Argument name.- Throws:
IllegalArgumentException
- Argument is null or empty.
-
-