Java Collection Empty isEmpty(Collection objs)

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

Description

is Empty

License

Apache License

Declaration

public static boolean isEmpty(Collection<?> objs) 

Method Source Code


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

import java.util.Collection;

public class Main {
    public static boolean isEmpty(Object objs) {
        if (objs == null) {
            return true;
        }/*from  w  w  w .j a va  2 s  .  co  m*/
        return false;
    }

    public static boolean isEmpty(Object[] objs) {
        if ((objs == null) || (objs.length == 0)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(Collection<?> objs) {
        if ((objs == null) || (objs.size() <= 0)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(byte[] objs) {
        if ((objs == null) || (objs.length == 0)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(String str) {
        if ((str == null) || (str.trim().length() == 0)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(Long l) {
        if ((l == null) || (l.longValue() == 0L)) {
            return true;
        }
        return false;
    }
}

Related

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