Here you can find the source of isNullOrEmpty(final Collection> value)
Parameter | Description |
---|---|
value | Value to test. |
public static boolean isNullOrEmpty(final Collection<?> value)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from w w w . j a va2 s. com*/ * Tests given value to see if it is empty. * * @param value * Value to test. * @return True if empty. */ public static boolean isNullOrEmpty(final Collection<?> value) { return isNull(value) || isEmpty(value); } /** * Tests given value to see if it is empty. * * @param value * Value to test. * @return True if empty. */ public static boolean isNullOrEmpty(final Object[] value) { return isNull(value) || isEmpty(value); } /** * Tests given value to see if it is empty. * * @param value * Value to test. * @return True if empty. */ public static boolean isNullOrEmpty(final String value) { return isNull(value) || isEmpty(value); } /** * Method to check for null. This is here just for completeness. * * @param arg * Any object. * @return True if null false if not. */ public static boolean isNull(final Object arg) { return null == arg; } /** * Tests given value to see if it is empty. * * @param value * Value to test. Does not check to see if it is null. * @return True if empty. */ public static boolean isEmpty(final Collection<?> value) { return 0 == value.size(); } /** * Tests given value to see if it is empty. * * @param value * Value to test. Does not check to see if it is null. * @return True if empty. */ public static boolean isEmpty(final Object[] value) { return 0 == value.length; } /** * Tests given value to see if it is empty. * * @param value * Value to test. Does not check to see if it is null. * @return True if empty. */ public static boolean isEmpty(final String value) { return 0 == value.length(); } }