Package org.springframework.boot.origin
Class PropertySourceOrigin
- java.lang.Object
- org.springframework.boot.origin.PropertySourceOrigin
- All Implemented Interfaces:
Origin
public class PropertySourceOrigin extends Object implements Origin
Origin
from aPropertySource
.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description PropertySourceOrigin(org.springframework.core.env.PropertySource<?> propertySource, String propertyName)
Create a newPropertySourceOrigin
instance.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Origin
get(org.springframework.core.env.PropertySource<?> propertySource, String name)
String
getPropertyName()
Return the property name that was used when obtaining the original value from theproperty source
.org.springframework.core.env.PropertySource<?>
getPropertySource()
Return the originPropertySource
.String
toString()
Constructor Detail
PropertySourceOrigin
public PropertySourceOrigin(org.springframework.core.env.PropertySource<?> propertySource, String propertyName)
Create a newPropertySourceOrigin
instance.- Parameters:
propertySource
- the property sourcepropertyName
- the name from the property source
Method Detail
getPropertySource
public org.springframework.core.env.PropertySource<?> getPropertySource()
Return the originPropertySource
.- Returns:
- the origin property source
getPropertyName
public String getPropertyName()
Return the property name that was used when obtaining the original value from theproperty source
.- Returns:
- the origin property name
get
public static Origin get(org.springframework.core.env.PropertySource<?> propertySource, String name)
Get anOrigin
for the givenPropertySource
andpropertyName
. Will either return anOriginLookup
result or aPropertySourceOrigin
.- Parameters:
propertySource
- the origin property sourcename
- the property name- Returns:
- the property origin