Class PropertiesUtils
java.lang.Object
org.apache.pulsar.client.internal.PropertiesUtils
Internal utility methods for filtering and mapping
Properties
objects.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilterAndMapProperties
(Properties props, String prefix) Filters theProperties
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.filterAndMapProperties
(Properties props, String srcPrefix, String targetPrefix) Filters theProperties
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.
-
Constructor Details
-
PropertiesUtils
public PropertiesUtils()
-
-
Method Details
-
filterAndMapProperties
Filters theProperties
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.- Parameters:
props
- - the properties object to filterprefix
- - the prefix to filter against and then remove for keys in the resulting map- Returns:
- a map of properties
-
filterAndMapProperties
public static Map<String,Object> filterAndMapProperties(Properties props, String srcPrefix, String targetPrefix) Filters theProperties
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.- Parameters:
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 map- Returns:
- a map of properties
-