org.springframework.boot.origin

Class PropertySourceOrigin

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


    public class PropertySourceOrigin
    extends java.lang.Object
    implements Origin
    Origin from a PropertySource.
    Since:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      PropertySourceOrigin(org.springframework.core.env.PropertySource<?> propertySource, java.lang.String propertyName)
      Create a new PropertySourceOrigin instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static Origin get(org.springframework.core.env.PropertySource<?> propertySource, java.lang.String name)
      Get an Origin for the given PropertySource and propertyName.
      java.lang.String getPropertyName()
      Return the property name that was used when obtaining the original value from the property source.
      org.springframework.core.env.PropertySource<?> getPropertySource()
      Return the origin PropertySource.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.springframework.boot.origin.Origin

        from
    • Constructor Detail

      • PropertySourceOrigin

        public PropertySourceOrigin(org.springframework.core.env.PropertySource<?> propertySource,
                                    java.lang.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 java.lang.String getPropertyName()
        Return the property name that was used when obtaining the original value from the property source.
        Returns:
        the origin property name
      • toString

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

        public static Origin get(org.springframework.core.env.PropertySource<?> propertySource,
                                 java.lang.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