Class PropertiesUtils
- java.lang.Object
-
- org.apache.pulsar.client.internal.PropertiesUtils
-
public class PropertiesUtils extends java.lang.ObjectInternal utility methods for filtering and mappingPropertiesobjects.
-
-
Constructor Summary
Constructors Constructor Description PropertiesUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>filterAndMapProperties(java.util.Properties props, java.lang.String prefix)Filters thePropertiesobject 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 java.util.Map<java.lang.String,java.lang.Object>filterAndMapProperties(java.util.Properties props, java.lang.String srcPrefix, java.lang.String targetPrefix)Filters thePropertiesobject 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.
-
-
-
Method Detail
-
filterAndMapProperties
public static java.util.Map<java.lang.String,java.lang.Object> filterAndMapProperties(java.util.Properties props, java.lang.String prefix)Filters thePropertiesobject 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 java.util.Map<java.lang.String,java.lang.Object> filterAndMapProperties(java.util.Properties props, java.lang.String srcPrefix, java.lang.String targetPrefix)Filters thePropertiesobject 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
-
-