Java Array Empty Check isEmpty(Object[] array)

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

Description

is Empty

License

Open Source License

Declaration

public static boolean isEmpty(Object[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

import java.util.List;
import java.util.Map;

public class Main {

    public static boolean isEmpty(Map<?, ?> map) {
        return ((map == null) || (map.size() == 0));
    }/*ww w. j  av a  2s. co m*/

    public static boolean isEmpty(Collection<?> collection) {
        return ((collection == null) || (collection.size() == 0));
    }

    public static boolean isEmpty(Object[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(List<?> array) {
        return ((array == null) || (array.size() == 0));
    }

    public static boolean isEmpty(long[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(int[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(short[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(byte[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(double[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(float[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(boolean[] array) {
        return ((array == null) || (array.length == 0));
    }

    public static boolean isEmpty(char[] array) {
        return ((array == null) || (array.length == 0));
    }
}

Related

  1. isEmpty(Object[] array)
  2. isEmpty(Object[] array)
  3. isEmpty(Object[] array)
  4. isEmpty(Object[] array)
  5. isEmpty(Object[] array)
  6. isEmpty(Object[] array)
  7. isEmpty(Object[] arrs)
  8. isEmpty(Object[] obj)
  9. isEmpty(Object[] values)