Class PropertiesUtils

java.lang.Object
org.apache.pulsar.client.internal.PropertiesUtils

public class PropertiesUtils extends Object
Internal utility methods for filtering and mapping Properties objects.
  • Constructor Details

    • PropertiesUtils

      public PropertiesUtils()
  • Method Details

    • filterAndMapProperties

      public 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.
      Parameters:
      props - - the properties object to filter
      prefix - - 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 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.
      Parameters:
      props - - the properties object to filter
      srcPrefix - - the prefix to filter against and then remove for keys in the resulting map
      targetPrefix - - the prefix to add to keys in the result map
      Returns:
      a map of properties