public class Convention extends Object
Modifier and Type | Method and Description |
---|---|
static 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 null
|
static void |
throwIfNullOrEmpty(String value,
String message)
Throws an exception if null or empty
|
public static void throwIfNull(Object value, String message)
value
- object to check if nullmessage
- message to use when thrownIllegalArgumentException
- if the string passed in is null or emptypublic static void throwIfNullOrEmpty(String value, String message)
value
- string to checkmessage
- message to use when thrownIllegalArgumentException
- if the string passed in is null or emptypublic static void throwIfClassNotFound(String fullyQualifiedClassName, ClassLoader loader)
public static void throwIfFalse(boolean logic, String message)
logic
- test to see if we need to throw the exception.message
- to include in the exception explaining why the the assertion failedCopyright © 2024. All rights reserved.