public final class PropsUtil extends Object
| 构造器和说明 |
|---|
PropsUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
getBoolean(Properties props,
String key)
获取布尔型属性(默认值为false)
|
static boolean |
getBoolean(Properties props,
String key,
Boolean defaultValue)
获取布尔型属性(可指定默认值)
|
static int |
getInt(Properties props,
String key)
获取数值型属性(默认值为0)
|
static int |
getInt(Properties props,
String key,
int defaultValue)
获取数值型属性(可指定默认值)
|
static String |
getString(Properties props,
String key)
获取字符型属性(默认值为空客串)
|
static String |
getString(Properties props,
String key,
String defaultValue)
获取字符型属性(可指定默认值)
|
static Properties |
loadProps(String fileName)
加载属性文件
|
public static Properties loadProps(String fileName)
public static String getString(Properties props, String key)
public static String getString(Properties props, String key, String defaultValue)
public static int getInt(Properties props, String key)
public static int getInt(Properties props, String key, int defaultValue)
public static boolean getBoolean(Properties props, String key)
public static boolean getBoolean(Properties props, String key, Boolean defaultValue)
Copyright © 2017. All rights reserved.