Here you can find the source of isEmpty(T[] array)
Parameter | Description |
---|---|
array | The array to test. |
public static <T extends Object> boolean isEmpty(T[] array)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**/*from w ww.ja v a2 s .co m*/ * Returns if the given {@code collection} is {@code null} or empty. * * @param collection * The collection to test. * @return {@code true} if the given {@code collection} is {@code null} or {@code empty}. */ public static <C extends Collection<?>> boolean isEmpty(C collection) { return collection == null || collection.isEmpty(); } /** * Returns if the given {@code array} is {@code null} or empty. * * @param array * The array to test. * @return {@code true} if the given {@code array} is {@code null} or {@code empty}. */ public static <T extends Object> boolean isEmpty(T[] array) { return array == null || array.length == 0; } /** * Returns if the given {@code map} is {@code null} or empty. * * @param map * The map to test. * @return {@code true} if the given {@code map} is {@code null} or {@code empty}. */ public static <M extends Map<?, ?>> boolean isEmpty(M map) { return map == null || map.isEmpty(); } }