Package org.pentaho.di.core.util
Class Assert
- java.lang.Object
-
- org.pentaho.di.core.util.Assert
-
public final class Assert extends Object
- Version:
- $Revision
- Author:
- Thomas Hoedl(asc042)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertFalse(boolean bool)static voidassertFalse(boolean bool, String message, Object... args)static voidassertFalse(Object input, org.apache.commons.collections.Predicate predicate)static voidassertGreaterZero(Double value)static voidassertGreaterZero(Double value, String message)static voidassertGreaterZero(Integer value)static voidassertGreaterZero(Integer value, String message)static voidassertNotBlank(String input)static voidassertNotBlank(String input, String message)static voidassertNotEmpty(String input)static voidassertNotEmpty(String input, String message)static voidassertNotNull(Object input)static voidassertNotNull(Object input, String message)static voidassertNotNullOrEmpty(Object[] array)static voidassertNotNullOrEmpty(Object[] array, String message)static voidassertNotNullOrEmpty(Collection<?> collection)static voidassertNotNullOrEmpty(Collection<?> collection, String message)static voidassertNotNullOrEmpty(Map<?,?> map)static voidassertNotNullOrEmpty(Map<?,?> map, String message)static voidassertNull(Object input)static voidassertNull(Object input, String message)static voidassertTrue(boolean bool)static voidassertTrue(boolean bool, String message, Object... args)static voidassertTrue(Object input, org.apache.commons.collections.Predicate predicate)
-
-
-
Method Detail
-
assertTrue
public static void assertTrue(Object input, org.apache.commons.collections.Predicate predicate) throws IllegalArgumentException
- Parameters:
input- input to test.predicate- predicate to apply.- Throws:
IllegalArgumentException- if predicate rejected input.
-
assertTrue
public static void assertTrue(boolean bool) throws IllegalArgumentException- Parameters:
bool- boolean to test.- Throws:
IllegalArgumentException- if bool is false.
-
assertTrue
public static void assertTrue(boolean bool, String message, Object... args) throws IllegalArgumentException- Parameters:
message- message.bool- boolean to test.args- arguments to set, optional- Throws:
IllegalArgumentException- if bool is false.
-
assertFalse
public static void assertFalse(boolean bool) throws IllegalArgumentException- Parameters:
bool- boolean to test.- Throws:
IllegalArgumentException- if bool is true.
-
assertFalse
public static void assertFalse(boolean bool, String message, Object... args) throws IllegalArgumentException- Parameters:
bool- boolean to test.message- message.args- optinal arguments.- Throws:
IllegalArgumentException- if bool is true.
-
assertFalse
public static void assertFalse(Object input, org.apache.commons.collections.Predicate predicate) throws IllegalArgumentException
- Parameters:
input- input to test.predicate- predicate to apply.- Throws:
IllegalArgumentException- if predicate didn't rejected input.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Collection<?> collection) throws IllegalArgumentException
- Parameters:
collection- collection to test.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Collection<?> collection, String message) throws IllegalArgumentException
- Parameters:
collection- collection to test.message- the message.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Object[] array) throws IllegalArgumentException
- Parameters:
array- collection to test.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Object[] array, String message) throws IllegalArgumentException
- Parameters:
array- array to test.message- the message.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Map<?,?> map) throws IllegalArgumentException
- Parameters:
map- collection to test.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotNullOrEmpty
public static void assertNotNullOrEmpty(Map<?,?> map, String message) throws IllegalArgumentException
- Parameters:
map- map to test.message- the message.- Throws:
IllegalArgumentException- if collection is null or empty.
-
assertNotEmpty
public static void assertNotEmpty(String input) throws IllegalArgumentException
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotEmpty
public static void assertNotEmpty(String input, String message) throws IllegalArgumentException
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotBlank
public static void assertNotBlank(String input) throws IllegalArgumentException
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotBlank
public static void assertNotBlank(String input, String message) throws IllegalArgumentException
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotNull
public static void assertNotNull(Object input) throws IllegalArgumentException
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null.
-
assertNotNull
public static void assertNotNull(Object input, String message) throws IllegalArgumentException
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null.
-
assertNull
public static void assertNull(Object input) throws IllegalArgumentException
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input isn't null.
-
assertNull
public static void assertNull(Object input, String message) throws IllegalArgumentException
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input isn't null.
-
assertGreaterZero
public static void assertGreaterZero(Integer value) throws IllegalArgumentException
- Parameters:
value- value to test.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
public static void assertGreaterZero(Double value) throws IllegalArgumentException
- Parameters:
value- value to test.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
public static void assertGreaterZero(Double value, String message) throws IllegalArgumentException
- Parameters:
value- value to test.message- the message.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
public static void assertGreaterZero(Integer value, String message) throws IllegalArgumentException
- Parameters:
value- value to test.message- the message.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
-