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

cloud.agileframework.common.util.number.NumberUtil Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package cloud.agileframework.common.util.number;

import org.apache.commons.lang3.math.NumberUtils;

/**
 * @author 佟盟
 * 日期 2019/10/30 10:50
 * 描述 数字工具
 * @version 1.0
 * @since 1.0
 */
public class NumberUtil extends NumberUtils {
    /**
     * 判断是否为数字类型
     *
     * @param clazz 类型
     * @return 是否
     */
    public static boolean isNumber(Class clazz) {
        if (Number.class.isAssignableFrom(clazz)) {
            return true;
        } else {
            return clazz == short.class || clazz == int.class || clazz == long.class || clazz == double.class || clazz == float.class;
        }
    }

    public static void main(String[] args) {
        Long.class.isAssignableFrom(long.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy