Java Array Empty Check isNotEmpty(Object[] array)

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

Description

Method description

License

Open Source License

Parameter

Parameter Description
array a parameter

Declaration

public static boolean isNotEmpty(Object[] array) 

Method Source Code

//package com.java2s;

import java.util.Collection;

import java.util.Map;

public class Main {
    /**//  w w  w .  jav a  2  s .c om
     * Method description
     *
     *
     * @param value
     *
     * @return
     */
    public static boolean isNotEmpty(String value) {
        return (value != null) && (value.trim().length() > 0);
    }

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

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

    /**
     * Method description
     *
     *
     * @param array
     *
     * @return
     */
    public static boolean isNotEmpty(Object[] array) {
        return (array != null) && (array.length > 0);
    }

    /**
     * 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(T[] array)
  2. isEmptyOrNull(Object[] array)
  3. isEmptyOrNull(Object[] array)
  4. isNonEmpty(Object[] array)
  5. isNotEmpty(boolean[] values)
  6. isNotEmpty(Object[] array)
  7. isNotEmpty(Object[] array)
  8. isNotEmpty(Object[] array)
  9. isNotEmpty(Object[] arrs)