public static Boolean checkRange(Integer num, Integer min, Integer max, Boolean throwException)
    {
        Boolean condition;
        if (min == null)
            condition = num > max;
        else if (max == null)
            condition = num < min;
        else
            condition = num < min || num > max;
        if (condition)
            if (throwException)
                throw new RuntimeException("数值：" + num + "，超出值域范围：最小值：" + min + "，最大值：" + max);
            else
                return false;
        return true;
    }