Java Collection Empty isNotEmpty(final Collection coll)

Here you can find the source of isNotEmpty(final Collection coll)

Description

Return if a collection is not empty.

License

Apache License

Parameter

Parameter Description
coll a collection

Return

whether it is not empty

Declaration

public static boolean isNotEmpty(final Collection<?> coll) 

Method Source Code

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

import java.util.Collection;

public class Main {
    /**//from  w ww. j  a va2s . c o m
     * Return if a collection is not empty.
     *
     * @param coll a collection
     * @return whether it is not empty
     */
    public static boolean isNotEmpty(final Collection<?> coll) {
        return !isEmpty(coll);
    }

    /**
     * Return if a collection is empty.
     *
     * @param coll a collection
     * @return whether it is empty
     */
    public static boolean isEmpty(final Collection<?> coll) {
        return coll == null || coll.isEmpty();
    }

    private static boolean isEmpty(final CharSequence cs) {
        return cs == null || cs.length() == 0;
    }
}

Related

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