org.springframework.boot.bind

Class PropertySourceUtils



  • public abstract class PropertySourceUtils
    extends Object
    Convenience class for manipulating PropertySources.
    Author:
    Dave Syer
    See Also:
    PropertySource, PropertySources
    • Constructor Detail

      • PropertySourceUtils

        public PropertySourceUtils()
    • Method Detail

      • getSubProperties

        public static Map<String,Object> getSubProperties(org.springframework.core.env.PropertySources propertySources,
                                                          String keyPrefix)
        Return a Map of all values from the specified PropertySources that start with a particular key.
        Parameters:
        propertySources - the property sources to scan
        keyPrefix - the key prefixes to test
        Returns:
        a map of all sub properties starting with the specified key prefixes.
        See Also:
        getSubProperties(PropertySources, String, String)
      • getSubProperties

        public static Map<String,Object> getSubProperties(org.springframework.core.env.PropertySources propertySources,
                                                          String rootPrefix,
                                                          String keyPrefix)
        Return a Map of all values from the specified PropertySources that start with a particular key.
        Parameters:
        propertySources - the property sources to scan
        rootPrefix - a root prefix to be prepended to the keyPrefix (can be null)
        keyPrefix - the key prefixes to test
        Returns:
        a map of all sub properties starting with the specified key prefixes.
        See Also:
        getSubProperties(PropertySources, String, String)

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.