Example usage for java.util Collection isEmpty

List of usage examples for java.util Collection isEmpty

Introduction

In this page you can find the example usage for java.util Collection isEmpty.

Prototype

boolean isEmpty();

Source Link

Document

Returns true if this collection contains no elements.

Usage

From source file:Main.java

public static boolean isCollectionEmpty(Collection col) {
    return col == null || col.isEmpty();
}

From source file:Main.java

/**
 * Checks whether given collection is not null or non-empty.
 * @param c Colletion instance//from w w  w  . jav a 2s  .  c o m
 * @return true if not null or non-empty, otherwise false;
 */
public static boolean isNullOrEmpty(Collection c) {
    return c == null || c.isEmpty();
}

From source file:Main.java

public static boolean isEmpty(Collection<?> c) {
    if (c == null || c.isEmpty()) {
        return true;
    }// w w w .j  av  a2 s.  c  om
    return false;
}

From source file:Main.java

public static <T> boolean isEmpty(Collection<T> c) {
    if (c == null || c.isEmpty()) {
        return true;
    }/*from  ww w  .  j  av  a2 s  .  c o m*/
    return false;
}

From source file:Main.java

@SuppressWarnings("unchecked")
public static boolean isEmpty(Collection c) {
    return null == c || c.isEmpty();
}

From source file:Main.java

/**
 * Checks whether given collection is not null or non-empty.
 * @param c Colletion instance/*from   www . ja v  a  2 s .c  o  m*/
 * @return true if not null or non-empty, otherwise false;
 */
public static boolean isNonEmpty(Collection c) {
    return c != null && !c.isEmpty();
}

From source file:Main.java

public static boolean isEmpty(Collection c) {
    return c == null || c.isEmpty();
}

From source file:Main.java

public static boolean isEmpty(Collection set) {
    return set == null || set.isEmpty();
}

From source file:Main.java

public static <T> boolean isEmpty(Collection<T> c) {
    return c == null || c.isEmpty();
}

From source file:Main.java

public static boolean isEmpty(Collection coll) {
    return coll == null || coll.isEmpty();
}