Java Collection Empty isNotEmpty(Collection collection)

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

Description

is Not Empty

License

LGPL

Return

true if there is at least one item in the collection, false otherwise

Declaration

public static boolean isNotEmpty(Collection<?> collection) 

Method Source Code

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

import java.util.Collection;

import java.util.Map;

public class Main {
    /**//from   w w w . j  a  va  2 s.  c  o m
     * @return true if there is at least one item in the map, false otherwise
     */
    public static boolean isNotEmpty(Map<?, ?> map) {
        return map != null && !map.isEmpty();
    }

    /**
     * @return true if there is at least one item in the collection, false otherwise
     */
    public static boolean isNotEmpty(Collection<?> collection) {
        return collection != null && !collection.isEmpty();
    }

    /**
     * @return true if there the string length greater than 0, false otherwise
     */
    public static boolean isNotEmpty(final CharSequence string) {
        return string != null && string.length() > 0;
    }
}

Related

  1. isNotEmpty(Collection c)
  2. isNotEmpty(Collection col)
  3. isNotEmpty(Collection colecao)
  4. isNotEmpty(Collection coll)
  5. isNotEmpty(Collection collection)
  6. isNotEmpty(Collection collection)
  7. isNotEmpty(Collection collection)
  8. isNotEmpty(Collection collection)
  9. isNotEmpty(Collection collection)