public class PropertiesKits extends Object
copy from vipshop VJTools(com.vip.vjtools.vjkit.base.PropertiesUtil) and made some changes.
| 构造器和说明 |
|---|
PropertiesKits() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Boolean |
getBoolean(Properties p,
String name,
Boolean defaultValue) |
static Double |
getDouble(Properties p,
String name,
Double defaultValue) |
static Float |
getFloat(Properties p,
String name,
Float defaultValue) |
static Integer |
getInt(Properties p,
String name,
Integer defaultValue) |
static Long |
getLong(Properties p,
String name,
Long defaultValue) |
static String |
getString(Properties p,
String name,
String defaultValue) |
static Properties |
loadFromFile(String generalPath)
从文件路径加载properties.
|
static Properties |
loadFromString(String content)
从字符串内容加载Properties
|
public static Boolean getBoolean(Properties p, String name, Boolean defaultValue)
public static Integer getInt(Properties p, String name, Integer defaultValue)
public static Long getLong(Properties p, String name, Long defaultValue)
public static Double getDouble(Properties p, String name, Double defaultValue)
public static Float getFloat(Properties p, String name, Float defaultValue)
public static String getString(Properties p, String name, String defaultValue)
public static Properties loadFromFile(String generalPath)
路径支持从外部文件或resources文件加载, "file://"或无前缀代表外部文件, "classpath:"代表resources
public static Properties loadFromString(String content)
Copyright © 2019. All rights reserved.