Class PropertiesUtils


  • public class PropertiesUtils
    extends java.lang.Object
    Internal utility methods for filtering and mapping Properties objects.
    • 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 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 java.util.Map<java.lang.String,​java.lang.Object> filterAndMapProperties​(java.util.Properties props, java.lang.String srcPrefix, java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertiesUtils

        public PropertiesUtils()
    • Method Detail

      • filterAndMapProperties

        public static java.util.Map<java.lang.String,​java.lang.Object> filterAndMapProperties​(java.util.Properties props,
                                                                                                    java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> filterAndMapProperties​(java.util.Properties props,
                                                                                                    java.lang.String srcPrefix,
                                                                                                    java.lang.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