Java Collection Empty isNotEmpty(Collection collection)

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

Description

is Not Empty

License

Apache License

Declaration

public static boolean isNotEmpty(Collection collection) 

Method Source Code

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

import java.util.Collection;

import java.util.Map;

public class Main {

    public static boolean isNotEmpty(Collection collection) {
        return !isEmpty(collection);
    }/* w  w w .  j a v  a  2 s.c om*/

    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean isEmpty(Collection collection) {
        if (null == collection || collection.isEmpty()) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(Map map) {
        if (null == map || map.isEmpty()) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(String str) {
        if (null == str || "".equals(str)) {
            return true;
        }
        return false;
    }

    public static boolean equals(String str1, String str2) {
        return str1 == null ? str2 == null : str1.equals(str2);
    }

    public static boolean equals(Long i1, Long i2) {
        return i1 == null ? i2 == null : i1.longValue() == i2.longValue();
    }
}

Related

  1. isNotEmpty(@SuppressWarnings("rawtypes") Collection collection)
  2. isNotEmpty(Collection c)
  3. isNotEmpty(Collection collection)
  4. isNotEmpty(Collection collection)
  5. isNotEmpty(Collection collection)
  6. isNotEmpty(Collection collection)
  7. isNotEmpty(Collection collection)
  8. isNotEmpty(Collection collection)
  9. isNotEmpty(Collection collection)