Java Array Empty Check isNullOrEmpty(T[] array)

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

Description

is Null Or Empty

License

Apache License

Declaration

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

Method Source Code


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

import java.util.Collection;

import java.util.Map;

public class Main {
    public static boolean isNullOrEmpty(Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }/*from www  . ja v  a2 s. c om*/

    public static boolean isNullOrEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }

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

Related

  1. isNotEmpty(T[] array)
  2. isNotNullAndNotEmpty(final Object[] array)
  3. isNotNullOrEmpty(T[] array)
  4. isNullOrEmpty(Object[] array)
  5. isNullOrEmpty(String[] s)
  6. isNullOrEmptyOrFirstElementBlank(String[] values)
  7. normalizeTokens(String[] tokens, boolean removeEmpty)
  8. nullOrEmpty(Object[] array)
  9. removeEmpty(String[] strings)