Java Collection Empty isNotEmpty(E collection)

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

Description

is Not Empty

License

Apache License

Declaration

public static <E extends Collection> boolean isNotEmpty(E collection) 

Method Source Code


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

import java.util.Collection;

public class Main {
    public static <E extends Collection> boolean isNotEmpty(E collection) {
        if (collection == null)
            return false;
        if (collection.isEmpty())
            return false;
        return true;
    }// w  ww  . ja  v a  2s .com

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

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

Related

  1. isNotEmpty(Collection values)
  2. isNotEmpty(Collection... colls)
  3. isNotEmpty(Collection collection)
  4. isNotEmpty(Collection collection)
  5. isNotEmpty(Collection values)
  6. isNotEmpty(final Collection coll)
  7. isNotEmpty(final Collection collection)
  8. isNotEmpty(final Collection collection)
  9. isNotEmpty(final Collection collection)