Java Array Empty Check isEmpty(T[] arr)

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

Description

is Empty

License

Apache License

Declaration

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

Method Source Code


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

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

public class Main {
    public static <T> boolean isEmpty(T[] arr) {
        return arr == null || arr.length <= 0;
    }//  w w  w.  j  ava2s  . c  o m

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

    public static <T> boolean isEmpty(Set<T> set) {
        return set == null || set.size() <= 0;
    }

    public static <K, V> boolean isEmpty(Map<K, V> map) {
        return map == null || map.size() <= 0;
    }
}

Related

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