Java Array Empty Check isEmpty(final X[] array)

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

Description

is Empty

License

Open Source License

Declaration

public static <X> boolean isEmpty(final X[] array) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static <X> boolean isEmpty(final X[] array) {
        return (isNull(array) || 0 == array.length);
    }//from  w  ww  .  ja v a 2  s . c o m

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

    public static boolean isNull(final Object obj) {
        return (null == obj);
    }
}

Related

  1. isEmpty(boolean[] values)
  2. isEmpty(byte[] array)
  3. isEmpty(E[] array)
  4. isEmpty(final int[] arr)
  5. isEmpty(final Object[] array)
  6. isEmpty(int[] array)
  7. isEmpty(int[] array)
  8. isEmpty(Object[] args)
  9. isEmpty(Object[] arr)