Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * @(#)CollectionUtil.java 
 * 
 * create by x_chenbiwu at 2008-3-7
 * 
 * Copyright 2008 fivemen,Inc. All rights reserved.
 * 
 * fivemen proprietary/confidential.Use is subject to license terms
 */

import java.util.Collection;
import java.util.Dictionary;
import java.util.Map;

public class Main {

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

    public static boolean isNullOrNothing(final Dictionary dict) {
        return dict == null || dict.isEmpty();
    }

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

    public static boolean isNullOrNothing(final Object[] array) {
        return array == null || array.length == 0;
    }
}