Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    /**
     * Utility method to check if a collection is null or empty
     * 
     * @param collection
     * @return
     */
    public static boolean isNullOrEmpty(Collection<?> collection) {
        if (collection == null || collection.isEmpty())
            return true;
        return false;
    }

    /**
     * Utility method to check if a map is null or empty
     * 
     * @param map
     * @return
     */
    public static boolean isNullOrEmpty(Map<?, ?> map) {
        if (map == null || map.isEmpty())
            return true;
        return false;
    }
}