/** * Assert that a Map has entries; that is, it must not be <code>null</code> * and must have at least one entry. * <pre class="code">Assert.notEmpty(map);</pre> * @param map the map to check * @throws IllegalArgumentException if the map is <code>null</code> or has no entries */ public static void notEmpty(Map map) { notEmpty(map, "[Assertion failed] - this map must not be empty; it must contain at least one entry"); }
/** * Assert that an array has elements; that is, it must not be * <code>null</code> and must have at least one element. * <pre class="code">Assert.notEmpty(array);</pre> * @param array the array to check * @throws IllegalArgumentException if the object array is <code>null</code> or has no elements */ public static void notEmpty(Object[] array) { notEmpty(array, "[Assertion failed] - this array must not be empty: it must contain at least 1 element"); }
/** * Assert that a collection has elements; that is, it must not be * <code>null</code> and must have at least one element. * <pre class="code">Assert.notEmpty(collection, "Collection must have elements");</pre> * @param collection the collection to check * @throws IllegalArgumentException if the collection is <code>null</code> or has no elements */ public static void notEmpty(Collection collection) { notEmpty(collection, "[Assertion failed] - this collection must not be empty: it must contain at least 1 element"); }
/** * Assert that a collection has elements; that is, it must not be * <code>null</code> and must have at least one element. * <pre class="code">Assert.notEmpty(collection, "Collection must have elements");</pre> * @param collection the collection to check * @throws IllegalArgumentException if the collection is <code>null</code> or has no elements */ public static void notEmpty(Collection collection) { notEmpty(collection, "[Assertion failed] - this collection must not be empty: it must contain at least 1 element"); }
/** * Assert that a Map has entries; that is, it must not be <code>null</code> * and must have at least one entry. * <pre class="code">Assert.notEmpty(map);</pre> * @param map the map to check * @throws IllegalArgumentException if the map is <code>null</code> or has no entries */ public static void notEmpty(Map map) { notEmpty(map, "[Assertion failed] - this map must not be empty; it must contain at least one entry"); }
/** * Assert that an array has elements; that is, it must not be * <code>null</code> and must have at least one element. * <pre class="code">Assert.notEmpty(array);</pre> * @param array the array to check * @throws IllegalArgumentException if the object array is <code>null</code> or has no elements */ public static void notEmpty(Object[] array) { notEmpty(array, "[Assertion failed] - this array must not be empty: it must contain at least 1 element"); }