Java List Null Empty isEmpty(List obj)

Here you can find the source of isEmpty(List obj)

Description

is Empty

License

Apache License

Declaration

public static boolean isEmpty(List<?> obj) 

Method Source Code

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

import java.util.List;
import java.util.Map;

public class Main {
    public static boolean isEmpty(String str) {
        return null == str || "".equals(str);
    }//www . java 2  s . c  o m

    public static boolean isEmpty(Object[] obj) {
        return null == obj || 0 == obj.length;
    }

    public static boolean isEmpty(Object obj) {
        if (null == obj) {
            return true;
        }
        if (obj instanceof String) {
            return ((String) obj).trim().isEmpty();
        }
        return !(obj instanceof Number) ? false : false;
    }

    public static boolean isEmpty(List<?> obj) {
        return null == obj || obj.isEmpty();
    }

    public static boolean isEmpty(Map<?, ?> obj) {
        return null == obj || obj.isEmpty();
    }
}

Related

  1. isEmpty(List values)
  2. isEmpty(List list)
  3. isEmpty(List aList)
  4. isEmpty(List collection)
  5. isEmpty(List list, String message)
  6. isEmpty(List list)
  7. isEmpty(List aList)
  8. isEmpty(List list)
  9. isEmpty(List objList)