Java Collection Empty isNullOrEmpty(Collection collection)

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

Description

is Null Or Empty

License

Apache License

Declaration

public static boolean isNullOrEmpty(Collection<?> collection) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static boolean isNullOrEmpty(String str) {
        return str == null || "".equals(str.trim())
                || "null".equalsIgnoreCase(str.trim())
                || "undefined".equalsIgnoreCase(str.trim());
    }//from   ww  w . j  a  v a2s .c  om

    public static boolean isNullOrEmpty(Object obj) {
        return obj == null || isNullOrEmpty(obj.toString());
    }

    public static boolean isNullOrEmpty(Collection<?> collection) {
        return collection == null || collection.isEmpty();
    }
}

Related

  1. isNullOrEmpty(Collection c)
  2. isNullOrEmpty(Collection coll)
  3. isNullOrEmpty(Collection collection)
  4. isNullOrEmpty(Collection collection)
  5. isNullOrEmpty(Collection col)
  6. isNullOrEmpty(Collection list)
  7. isNullOrEmpty(Collection obj)
  8. isNullOrEmpty(Collection s)
  9. isNullOrEmpty(Collection values)