Package org.pentaho.di.core.util
Class Assert
java.lang.Object
org.pentaho.di.core.util.Assert
- Version:
- $Revision
- Author:
- Thomas Hoedl(asc042)
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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
- 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
- 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
- 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
- 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
- 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
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotEmpty
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotBlank
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotBlank
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null or empty.
-
assertNotNull
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input is null.
-
assertNotNull
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input is null.
-
assertNull
- Parameters:
input- input to test.- Throws:
IllegalArgumentException- if input isn't null.
-
assertNull
- Parameters:
input- input to test.message- the message.- Throws:
IllegalArgumentException- if input isn't null.
-
assertGreaterZero
- Parameters:
value- value to test.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
- Parameters:
value- value to test.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
- Parameters:
value- value to test.message- the message.- Throws:
IllegalArgumentException- if value is null or <= 0.
-
assertGreaterZero
- Parameters:
value- value to test.message- the message.- Throws:
IllegalArgumentException- if value is null or <= 0.
-