Android Collection Empty Check isEmpty(Collection collection)

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

Description

*

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;
import java.util.Map;

public class Main {
    /**//  ww  w .  j a v  a2 s  . co m
     * *************************************************************
     */

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

    public static boolean isEmpty(Map map) {
        return null == map || map.isEmpty();
    }

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

    public static boolean isEmpty(int[] objs) {
        return null == objs || objs.length <= 0;
    }

    public static boolean isEmpty(CharSequence charSequence) {
        return null == charSequence || charSequence.length() <= 0;
    }
}

Related

  1. isNotNull(Collection coll)
  2. isNotNull(Collection collection)
  3. isNull(Collection coll)
  4. isNullOrEmpty(Collection collection)
  5. isEmpty(Collection collection)
  6. isEmptyCollection(Collection collection)