public class PropsUtil extends Object
| 构造器和说明 |
|---|
PropsUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
getBoolean(Properties props,
String key)
获取 boolean 类型属性(默认值为 false)
|
static boolean |
getBoolean(Properties props,
String key,
boolean defaultValue)
获取 boolean 类型属性(可指定默认值)
|
static int |
getInt(Properties props,
String key)
获取 int 类型的属性值(默认值为 0)
|
static int |
getInt(Properties props,
String key,
int defaultValue)
获取 int 类型的属性值(可指定默认值)
|
static String |
getString(Properties props,
String key)
获取 String 类型的属性值(默认值为空字符串)
|
static String |
getString(Properties props,
String key,
String defaultValue)
获取 String 类型的属性值(可指定默认值)
|
static Properties |
loadProps(String fileName)
加载属性文件
|
public static Properties loadProps(String fileName)
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 © 2019. All rights reserved.