All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.df.restypass.util.CommonTools Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package com.github.df.restypass.util;

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

/**
 * 通用工具
 * Created by darrenfu on 17-7-19.
 */
public class CommonTools {

    /**
     * Empty to null string.
     *
     * @param string the string
     * @return the string
     */
    public static String emptyToNull(String string) {
        return string == null || string.isEmpty() ? null : string;
    }

    /**
     * Is empty boolean.
     *
     * @param coll the coll
     * @return the boolean
     */
    public static boolean isEmpty(Collection coll) {
        return coll == null || coll.isEmpty();
    }

    /**
     * Is empty boolean.
     *
     * @param map the map
     * @return the boolean
     */
    public static boolean isEmpty(Map map) {
        return map == null || map.isEmpty();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy