org.springframework.boot.origin

Class PropertySourceOrigin

  • All Implemented Interfaces:
    Origin


    public class PropertySourceOrigin
    extends Object
    implements Origin
    Origin from a PropertySource.
    Since:
    2.0.0
    Author:
    Phillip Webb
    • Constructor Detail

      • PropertySourceOrigin

        public PropertySourceOrigin(org.springframework.core.env.PropertySource<?> propertySource,
                                    String propertyName)
        Create a new PropertySourceOrigin instance.
        Parameters:
        propertySource - the property source
        propertyName - the name from the property source
    • Method Detail

      • getPropertySource

        public org.springframework.core.env.PropertySource<?> getPropertySource()
        Return the origin PropertySource.
        Returns:
        the origin property source
      • getPropertyName

        public String getPropertyName()
        Return the property name that was used when obtaining the original value from the property source.
        Returns:
        the origin property name
      • get

        public static Origin get(org.springframework.core.env.PropertySource<?> propertySource,
                                 String name)
        Get an Origin for the given PropertySource and propertyName. Will either return an OriginLookup result or a PropertySourceOrigin.
        Parameters:
        propertySource - the origin property source
        name - the property name
        Returns:
        the property origin

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