Java Collection Empty isEmpty(Collection collection)

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

Description

is Empty

License

Open Source License

Declaration

public static boolean isEmpty(Collection<?> collection) 

Method Source Code


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

import java.util.Collection;

public class Main {
    public static boolean isEmpty(String string) {
        return string == null || string.isEmpty();
    }//from w w w .ja  v a  2  s.c  o m

    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }

    public static boolean isEmpty(Iterable<?> iterable) {
        return iterable == null || !iterable.iterator().hasNext();
    }

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

Related

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