public class PropertiesUtils extends Object
Properties objects.| Constructor and Description |
|---|
PropertiesUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
filterAndMapProperties(Properties props,
String prefix)
Filters the
Properties object so that only properties with the configured prefix are retained,
and then removes that prefix and puts the key value pairs into the result map. |
static Map<String,Object> |
filterAndMapProperties(Properties props,
String srcPrefix,
String targetPrefix)
Filters the
Properties object so that only properties with the configured prefix are retained,
and then replaces the srcPrefix with the targetPrefix when putting the key value pairs in the resulting map. |
public static Map<String,Object> filterAndMapProperties(Properties props, String prefix)
Properties object so that only properties with the configured prefix are retained,
and then removes that prefix and puts the key value pairs into the result map.props - - the properties object to filterprefix - - the prefix to filter against and then remove for keys in the resulting mappublic static Map<String,Object> filterAndMapProperties(Properties props, String srcPrefix, String targetPrefix)
Properties object so that only properties with the configured prefix are retained,
and then replaces the srcPrefix with the targetPrefix when putting the key value pairs in the resulting map.props - - the properties object to filtersrcPrefix - - the prefix to filter against and then remove for keys in the resulting maptargetPrefix - - the prefix to add to keys in the result mapCopyright © 2017–2022 Apache Software Foundation. All rights reserved.