Java Collection Empty isEmpty(Collection collection)

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

Description

is Empty

License

Open Source License

Return

TRUE is collection is null or contains no elements

Declaration

public static <T> boolean isEmpty(Collection<T> collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    /**/*from   ww w . j a v a  2  s . c om*/
     * @return TRUE is collection is null or contains no elements
     */
    public static <T> boolean isEmpty(Collection<T> collection) {
        return collection == null || collection.size() == 0;
    }

    /**
     * @return TRUE if string == null || string.length() == 0
     */
    public static <T> boolean isEmpty(String string) {
        return string == null || string.length() == 0;
    }
}

Related

  1. isEmpty(Collection c)
  2. isEmpty(Collection data)
  3. isEmpty(Collection objectCollection)
  4. isEmpty(Collection c)
  5. isEmpty(Collection c)
  6. isEmpty(Collection collection)
  7. isEmpty(Collection collection)
  8. isEmpty(Collection collection, String messgae)
  9. isEmpty(Collection items)

  10. HOME | Copyright © www.java2s.com 2016