Class Convention

java.lang.Object
com.cedarsoftware.util.Convention

public class Convention extends Object
  • Method Details

    • throwIfNull

      public static void throwIfNull(Object value, String message)
      Throws an exception if null
      Parameters:
      value - object to check if null
      message - message to use when thrown
      Throws:
      IllegalArgumentException - if the string passed in is null or empty
    • throwIfNullOrEmpty

      public static void throwIfNullOrEmpty(String value, String message)
      Throws an exception if null or empty
      Parameters:
      value - string to check
      message - message to use when thrown
      Throws:
      IllegalArgumentException - if the string passed in is null or empty
    • throwIfClassNotFound

      public static void throwIfClassNotFound(String fullyQualifiedClassName, ClassLoader loader)
    • throwIfKeyExists

      public static <K, V> void throwIfKeyExists(Map<K,V> map, K key, String message)
    • throwIfFalse

      public static void throwIfFalse(boolean logic, String message)
      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