Java Collection Null isNull(Collection collection)

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

Description

is Null

License

Open Source License

Declaration

public final static boolean isNull(Collection collection) 

Method Source Code


//package com.java2s;
import java.util.Collection;
import java.util.Map;

public class Main {
    public final static boolean isNull(Object[] objs) {
        if (objs == null || objs.length == 0) {
            return true;
        }/*from   w w  w .j  a v  a  2s  . c  o  m*/
        return false;
    }

    public final static boolean isNull(Integer integer) {
        if (integer == null || integer == 0) {
            return true;
        }
        return false;
    }

    public final static boolean isNull(Collection collection) {
        if (collection == null || collection.size() == 0) {
            return true;
        }
        return false;
    }

    public final static boolean isNull(Map map) {
        if (map == null || map.size() == 0) {
            return true;
        }
        return false;
    }

    public final static boolean isNull(String str) {
        return str == null || "".equals(str.trim()) || "null".equals(str.toLowerCase());
    }

    public final static boolean isNull(Long longs) {
        if (longs == null || longs == 0) {
            return true;
        }
        return false;
    }
}

Related

  1. hasAtLeastOneNotNullElement(Collection collection)
  2. hasCollectionNullItem(Collection collection)
  3. isAllNull(Collection values)
  4. isEmplyOrNull(Collection collection)
  5. isNotNull(Collection collection)
  6. isNull(Collection collection)
  7. isNull(Collection c)
  8. isNull(Collection collection)
  9. isNull(Collection collection)