Java Collection Empty isEmpty(Collection col)

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

Description

is Empty

License

Apache License

Declaration

public static boolean isEmpty(Collection<? extends Object> col) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.Map;

public class Main {

    public static boolean isEmpty(Collection<? extends Object> col) {
        return !isNotEmpty(col);
    }//from w w w  .  j av a 2s .c  om

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

    public static boolean isNotEmpty(Collection<? extends Object> col) {
        return col != null && col.size() > 0;
    }

    public static boolean isNotEmpty(Map<? extends Object, ? extends Object> map) {
        return map != null && map.size() > 0;
    }
}

Related

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