类 PropertiesUtils


  • public class PropertiesUtils
    extends java.lang.Object
    Internal utility methods for filtering and mapping Properties objects.
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      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.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • PropertiesUtils

        public PropertiesUtils()
    • 方法详细资料

      • 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.
        参数:
        props - - the properties object to filter
        prefix - - the prefix to filter against and then remove for keys in the resulting map
        返回:
        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.
        参数:
        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
        返回:
        a map of properties