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 isEmpty(Collection<?> c) {
    if (null == c || c.isEmpty()) {
        return true;
    }/*from   w  w w  .  ja v  a  2  s. c  om*/
    return false;
}

From source file:Main.java

public static boolean hasElements(Collection<?> coll) {
    return coll != null && !coll.isEmpty();
}

From source file:Main.java

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

From source file:Main.java

private static boolean isEmpty(Collection<?> coll) {
    return (coll == null || coll.isEmpty());
}

From source file:Main.java

public static <T> List<T> toImmutableList(final Collection<T> c) {
    if (c.isEmpty()) {
        return Collections.emptyList();
    } else {/*from   w  w w . j ava  2 s  .  com*/
        return Collections.unmodifiableList(new ArrayList<T>(c));
    }
}

From source file:Main.java

public static <T> Set<T> copyToLinkedHashSet(Collection<? extends T> src) {
    if (src.isEmpty()) {
        return Collections.emptySet();
    }//  www  .j a va  2s .com

    return Collections.unmodifiableSet(new LinkedHashSet<T>(src));
}

From source file:Main.java

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

From source file:Main.java

public static boolean isBlank(Collection<?> c) {
    return c != null && c.isEmpty();
}

From source file:Main.java

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

From source file:Main.java

public static boolean isNotEmpty(Collection input) {
    return input != null && !input.isEmpty();
}