Java Collection Empty isEmpty(final Collection collection)

Here you can find the source of isEmpty(final Collection collection)

Description

Returns true if the collection is null or empty; false otherwise.

License

Apache License

Parameter

Parameter Description
collection the collection to be tested.

Return

true if the collection is null or empty; false otherwise.

Declaration

public static boolean isEmpty(final Collection<?> collection) 

Method Source Code

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

import java.util.Collection;

public class Main {
    /**//  w ww . j a va 2 s  . com
     * Returns true if the collection is null or empty; false otherwise.
     * 
     * @param collection
     *            the collection to be tested.
     * @return true if the collection is null or empty; false otherwise.
     */
    public static boolean isEmpty(final Collection<?> collection) {

        return collection == null || collection.isEmpty();
    }
}

Related

  1. isEmpty(Collection c)
  2. isEmpty(final Collection values)
  3. isEmpty(final Collection coll)
  4. isEmpty(final Collection collection)
  5. isEmpty(final Collection collection)
  6. isEmpty(final Collection collection)
  7. isEmpty(final Collection value)
  8. isEmpty(final Collection c)
  9. isEmpty(final Collection c)