Java Array Empty Check isEmpty(Object[] array)

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

Description

Method description

License

Open Source License

Parameter

Parameter Description
array a parameter

Declaration

public static boolean isEmpty(Object[] array) 

Method Source Code

//package com.java2s;

import java.util.Collection;

import java.util.Map;

public class Main {
    /**//from   ww w  .j a  v a 2 s .  c o m
     * Method description
     *
     *
     * @param value
     *
     * @return
     */
    public static boolean isEmpty(String value) {
        return (value == null) || (value.trim().length() == 0);
    }

    /**
     * Method description
     *
     *
     * @param collection
     *
     * @return
     */
    public static boolean isEmpty(Collection<?> collection) {
        return (collection == null) || collection.isEmpty();
    }

    /**
     * Method description
     *
     *
     *
     * @param map
     *
     * @return
     */
    public static boolean isEmpty(Map<?, ?> map) {
        return (map == null) || map.isEmpty();
    }

    /**
     * Method description
     *
     *
     * @param array
     *
     * @return
     */
    public static boolean isEmpty(Object[] 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[] array)
  8. isEmpty(Object[] arrs)
  9. isEmpty(Object[] obj)