Java Collection Empty safeIsEmpty(Collection collection)

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

Description

safe Is Empty

License

Open Source License

Declaration

public static boolean safeIsEmpty(Collection collection) 

Method Source Code

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

import java.util.*;

public class Main {

    public static boolean safeIsEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }//w w  w.j  a v a  2s  .co  m

    public static boolean safeIsEmpty(Map<?, ?> map) {
        return map == null || map.isEmpty();
    }
}

Related

  1. nullOrEmptyToDefault(final Collection collection, final Collection defaultValue)
  2. nullToEmpty(Collection c)
  3. nullToEmpty(Collection coll)
  4. orEmpty(T collection)
  5. removeEmptyStrings(Collection data)