Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Collection;

public class Main {
    /**
     * 
     * @Title: isNotEmpty
     * @author:  wuwh 
     *
     * <p>check collection is empty</p>
     *
     * <pre>
     * CollectionUtil.isNotEmpty(null)   = false
     * Map.put("ddd","ddd");
     * CollectionUtil.isNotEmpty(Map)=true
     * </pre>
     *
     */
    public static boolean isNotEmpty(Collection collection) {
        return null != collection && !collection.isEmpty() ? true : false;
    }

    /**
     * 
     * @Title: isEmpty
     * @author:  wuwh 
     *
     * <p>check collection is empty</p>
     *
     * <pre>
     * CollectionUtil.isEmpty(null)   = true
     * Map.put("ddd","ddd");
     * CollectionUtil.isEmpty(Map)=false
     * </pre>
     *
     */
    public static boolean isEmpty(Collection collection) {
        return null != collection && !collection.isEmpty() ? false : true;
    }
}