Java Array Empty Check isEmpty(T[] array)

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

Description

is Empty

License

Apache License

Declaration

public static <T> boolean isEmpty(T[] array) 

Method Source Code


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

import java.util.Collection;

public class Main {
    public static <T> boolean isEmpty(Collection<T> collection) {
        return collection == null || collection.isEmpty();
    }//from ww  w .ja v a 2s.  co  m

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

    public static boolean isEmpty(byte[] 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;
    }

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

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

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

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

Related

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