| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CONFIG_DELIMITERS |
static String |
NULL_VALUE_PLACEHOLDER |
static String |
PLACEHOLDER_PREFIX |
static String |
PLACEHOLDER_SUFFIX |
| 构造器和说明 |
|---|
ResourceUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
add(String key,
String value) |
static boolean |
containsAnyProperty(String... keys) |
static boolean |
containsProperty(String key) |
static Properties |
getAllProperties()
获取所有配置的副本
|
static Properties |
getAllProperties(String prefix)
按前缀匹配配置列表
|
static Properties |
getAllProperties(String keyPattern,
boolean matchPrefix)
按key模糊匹配配置列表
|
static String |
getAndValidateProperty(String key) |
static String |
getAnyProperty(String... keys) |
static <T> T |
getBean(String prefix,
Class<T> clazz)
已过时。
|
static boolean |
getBoolean(String key) |
static boolean |
getBoolean(String key,
boolean defalutValue) |
static <T> T |
getConfigObject(String prefix,
Class<T> clazz) |
static <T> List<T> |
getConfigObjects(String prefix,
Class<T> clazz) |
static int |
getInt(String key) |
static int |
getInt(String key,
int defalutValue) |
static List<String> |
getList(String key) |
static long |
getLong(String key) |
static long |
getLong(String key,
long defalutValue) |
static Map<String,String> |
getMappingValues(String prefix) |
static String |
getProperty(String key) |
static String |
getProperty(String key,
String defaultValue) |
static List<String> |
getPropertyNames(String prefix) |
static void |
merge(Map<String,Object> properties) |
static void |
merge(Properties properties) |
static void |
printAllConfigs(List<String> hiddenKeys) |
static void |
remove(String key) |
static String |
replaceRefValue(String value) |
public static String CONFIG_DELIMITERS
public static Properties getAllProperties()
public static Properties getAllProperties(String prefix)
prefix - public static Properties getAllProperties(String keyPattern, boolean matchPrefix)
public static int getInt(String key)
public static int getInt(String key, int defalutValue)
public static long getLong(String key)
public static long getLong(String key, long defalutValue)
public static boolean getBoolean(String key)
public static boolean getBoolean(String key, boolean defalutValue)
public static void merge(Properties properties)
public static boolean containsProperty(String key)
public static boolean containsAnyProperty(String... keys)
@Deprecated public static <T> T getBean(String prefix, Class<T> clazz)
public static void remove(String key)
Copyright © 2025. All rights reserved.