Java Array Empty Check isNotEmpty(Object[] array)

Here you can find the source of isNotEmpty(Object[] array)

Description

is Not Empty

License

Apache License

Declaration

public static Boolean isNotEmpty(Object[] array) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static <T> Boolean isNotEmpty(List<T> list) {
        return !isEmpty(list);
    }//ww  w.  ja va2 s  . c  o m

    public static Boolean isNotEmpty(Object[] array) {
        return !isEmpty(array);
    }

    /**
     * list is empty?
     * @param list
     * @param <T>
     * @return
     */
    public static <T> Boolean isEmpty(List<T> list) {
        return list == null || list.size() <= 0;
    }

    /**
     *
     * array is empty?
     * @param array
     * @return
     */
    public static Boolean isEmpty(Object[] array) {
        return array == null || array.length <= 0;
    }
}

Related

  1. isEmptyOrNull(Object[] array)
  2. isNonEmpty(Object[] array)
  3. isNotEmpty(boolean[] values)
  4. isNotEmpty(Object[] array)
  5. isNotEmpty(Object[] array)
  6. isNotEmpty(Object[] array)
  7. isNotEmpty(Object[] arrs)
  8. isNotEmpty(Object[] ObjectArray)
  9. isNotEmpty(T[] array)