Package com.cedarsoftware.util
Class Convention
java.lang.Object
com.cedarsoftware.util.Convention
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
throwIfClassNotFound
(String fullyQualifiedClassName, ClassLoader loader) static void
throwIfFalse
(boolean logic, String message) Throws an exception if the logic is false.static <K,
V> void throwIfKeyExists
(Map<K, V> map, K key, String message) static void
throwIfNull
(Object value, String message) Throws an exception if nullstatic void
throwIfNullOrEmpty
(String value, String message) Throws an exception if null or empty
-
Method Details
-
throwIfNull
Throws an exception if null- Parameters:
value
- object to check if nullmessage
- message to use when thrown- Throws:
IllegalArgumentException
- if the string passed in is null or empty
-
throwIfNullOrEmpty
Throws an exception if null or empty- Parameters:
value
- string to checkmessage
- message to use when thrown- Throws:
IllegalArgumentException
- if the string passed in is null or empty
-
throwIfClassNotFound
-
throwIfKeyExists
-
throwIfFalse
Throws an exception if the logic is false.- Parameters:
logic
- test to see if we need to throw the exception.message
- to include in the exception explaining why the the assertion failed
-