Class PropertySourceOrigin

java.lang.Object
org.springframework.boot.origin.PropertySourceOrigin
All Implemented Interfaces:
Origin, OriginProvider

public class PropertySourceOrigin extends Object implements Origin, OriginProvider
Since:
2.0.0
Author:
Phillip Webb
  • Constructor Details

    • PropertySourceOrigin

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

      public PropertySourceOrigin(PropertySource<?> propertySource, String propertyName, Origin origin)
      Create a new PropertySourceOrigin instance.
      Parameters:
      propertySource - the property source
      propertyName - the name from the property source
      origin - the actual origin for the source if known
      Since:
      3.2.8
  • Method Details

    • getPropertySource

      public 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
    • getOrigin

      public Origin getOrigin()
      Return the actual origin for the source if known.
      Specified by:
      getOrigin in interface OriginProvider
      Returns:
      the actual source origin
      Since:
      3.2.8
    • getParent

      public Origin getParent()
      Description copied from interface: Origin
      Return the parent origin for this instance if there is one. The parent origin provides the origin of the item that created this one.
      Specified by:
      getParent in interface Origin
      Returns:
      the parent origin or null
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get

      public static Origin get(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