Java Collection Empty isEmpty(Collection c)

Here you can find the source of isEmpty(Collection c)

Description

True if the specified collection is null or empty.

License

Open Source License

Declaration

public static boolean isEmpty(Collection c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;
import java.util.Map;

public class Main {
    /**//from   w w w  .j  a v a 2  s  .  c o m
     * True if the specified string is null or empty.
     */
    public static boolean isEmpty(String s) {
        return s == null || s.length() == 0;
    }

    /**
     * True if the specified collection is null or empty.
     */
    public static boolean isEmpty(Collection c) {
        return c == null || c.isEmpty();
    }

    /**
     * True if the specified map is null or empty.
     */
    public static boolean isEmpty(Map m) {
        return m == null || m.isEmpty();
    }
}

Related

  1. isCollectionNullOrEmpty(Collection collection)
  2. isEmpty(Collection c)
  3. isEmpty(Collection c)
  4. isEmpty(Collection c)
  5. isEmpty(Collection c)
  6. isEmpty(Collection col)
  7. isEmpty(Collection collection)
  8. isEmpty(Collection collection)
  9. isEmpty(Collection collection)