Java Code Examples for com.ruoyi.common.utils.StringUtils#nvl()

The following examples show how to use com.ruoyi.common.utils.StringUtils#nvl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Global.java    From ruoyiplus with MIT License 4 votes vote down vote up
/**
 * 获取项目版本
 */
public static String getVersion()
{
    return StringUtils.nvl(getConfig("ruoyi.version"), "3.2.0");
}
 
Example 2
Source File: Global.java    From ruoyiplus with MIT License 4 votes vote down vote up
/**
 * 是否自动去除表前缀
 */
public static String getAutoRemovePre()
{
    return StringUtils.nvl(getConfig("gen.autoRemovePre"), "true");
}
 
Example 3
Source File: Global.java    From supplierShop with MIT License 4 votes vote down vote up
/**
 * 获取项目名称
 */
public static String getName()
{
    return StringUtils.nvl(getConfig("ruoyi.name"), "RuoYi");
}
 
Example 4
Source File: Global.java    From ruoyiplus with MIT License 4 votes vote down vote up
/**
 * 表前缀(类名不会包含表前缀)
 */
public static String getTablePrefix()
{
    return StringUtils.nvl(getConfig("gen.tablePrefix"), "sys_");
}
 
Example 5
Source File: Global.java    From supplierShop with MIT License 4 votes vote down vote up
/**
 * 获取版权年份
 */
public static String getCopyrightYear()
{
    return StringUtils.nvl(getConfig("ruoyi.copyrightYear"), "2019");
}
 
Example 6
Source File: Global.java    From ruoyiplus with MIT License 4 votes vote down vote up
/**
 * 生成包路径
 */
public static String getPackageName()
{
    return StringUtils.nvl(getConfig("gen.packageName"), "com.ruoyi.project.module");
}
 
Example 7
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 字段值按照布尔类型返回。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 字段值。
 */
public Boolean getBool(final String name, final Boolean defaultValue)
{
    return StringUtils.nvl(getBool(name), defaultValue);
}
 
Example 8
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的整数值,或者defaultValue。
 */
public Integer intValue(final String name, final Integer defaultValue)
{
    return StringUtils.nvl(intValue(name), defaultValue);
}
 
Example 9
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 返回字段字符串值。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 返回指定字段字符串值。
 */
public String getStr(final String name, final String defaultValue)
{
    return StringUtils.nvl(getStr(name), defaultValue);
}
 
Example 10
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 返回字段长整数值。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 返回指定字段长整数值。
 */
public Long getLong(final String name, Long defaultValue)
{
    return StringUtils.nvl(getLong(name), defaultValue);
}
 
Example 11
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 返回字段整数值。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 返回指定字段整数值。
 */
public Integer getInt(final String name, Integer defaultValue)
{
    return StringUtils.nvl(getInt(name), defaultValue);
}
 
Example 12
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的字符串值。如果字段不存在,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的字符串值,或者defaultValue。
 */
public String strValue(final String name, final String defaultValue)
{
    return StringUtils.nvl(strValue(name), defaultValue);
}
 
Example 13
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的长整数值,或者defaultValue。
 */
public Long longValue(final String name, final Long defaultValue)
{
    return StringUtils.nvl(longValue(name), defaultValue);
}
 
Example 14
Source File: JSONObject.java    From ruoyiplus with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的整数值。如果字段不存在,或者无法转换为整数,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的整数值,或者defaultValue。
 */
public Integer intValue(final String name, final Integer defaultValue)
{
    return StringUtils.nvl(intValue(name), defaultValue);
}
 
Example 15
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 字段值按照布尔类型返回。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 字段值。
 */
public Boolean getBool(final String name, final Boolean defaultValue)
{
    return StringUtils.nvl(getBool(name), defaultValue);
}
 
Example 16
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 返回字段字符串值。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 返回指定字段字符串值。
 */
public String getStr(final String name, final String defaultValue)
{
    return StringUtils.nvl(getStr(name), defaultValue);
}
 
Example 17
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 返回字段长整数值。如果不存在,返回defaultValue。
 * 
 * @param name 字段名。
 * @param defaultValue 字段不存在时,返回的值。
 * @return 返回指定字段长整数值。
 */
public Long getLong(final String name, Long defaultValue)
{
    return StringUtils.nvl(getLong(name), defaultValue);
}
 
Example 18
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的字符串值。如果字段不存在,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的字符串值,或者defaultValue。
 */
public String strValue(final String name, final String defaultValue)
{
    return StringUtils.nvl(strValue(name), defaultValue);
}
 
Example 19
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的布尔值。如果字段不存在,或者无法转换为布尔型,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的布尔值,或者defaultValue。
 */
public Boolean boolValue(final String name, final Boolean defaultValue)
{
    return StringUtils.nvl(boolValue(name), defaultValue);
}
 
Example 20
Source File: JSONObject.java    From supplierShop with MIT License 2 votes vote down vote up
/**
 * 获取指定字段的长整数值。如果字段不存在,或者无法转换为长整数,返回defaultValue。
 * 
 * @param name 字段名,支持多级。
 * @param defaultValue 查询失败时,返回的值。
 * @return 返回指定的长整数值,或者defaultValue。
 */
public Long longValue(final String name, final Long defaultValue)
{
    return StringUtils.nvl(longValue(name), defaultValue);
}