Class Assertions


  • public final class Assertions
    extends Object
    • Constructor Detail

      • Assertions

        public Assertions()
    • Method Detail

      • notNull

        public static <T> void notNull​(String name,
                                       T value)
        Throw IllegalArgumentException if the value is null.
        Type Parameters:
        T - the value type.
        Parameters:
        name - the parameter name.
        value - the value that should not be null.
        Throws:
        IllegalArgumentException - if value is null.
      • keyPresent

        public static void keyPresent​(String key,
                                      Map<String,​?> map)
        Throw IllegalStateException if key is not present in map.
        Parameters:
        key - the key to expect.
        map - the map to search.
        Throws:
        IllegalArgumentException - if key is not in map.