public class MutablePropertySources extends Object implements PropertySources
PropertySources interface.
 Allows manipulation of contained property sources and provides a constructor
 for copying an existing PropertySources instance.
 Where precedence is mentioned in methods such as addFirst(org.springframework.core.env.PropertySource<?>)
 and addLast(org.springframework.core.env.PropertySource<?>), this is with regard to the order in which property sources
 will be searched when resolving a given property with a PropertyResolver.
PropertySourcesPropertyResolver| Constructor and Description | 
|---|
| MutablePropertySources()Create a new  MutablePropertySourcesobject. | 
| MutablePropertySources(PropertySources propertySources)Create a new  MutablePropertySourcesfrom the given propertySources
 object, preserving the original order of containedPropertySourceobjects. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addAfter(String relativePropertySourceName,
        PropertySource<?> propertySource)Add the given property source object with precedence immediately lower
 than the named relative property source. | 
| void | addBefore(String relativePropertySourceName,
         PropertySource<?> propertySource)Add the given property source object with precedence immediately higher
 than the named relative property source. | 
| void | addFirst(PropertySource<?> propertySource)Add the given property source object with highest precedence. | 
| void | addLast(PropertySource<?> propertySource)Add the given property source object with lowest precedence. | 
| protected void | assertLegalRelativeAddition(String relativePropertySourceName,
                           PropertySource<?> propertySource)Ensure that the given property source is not being added relative to itself. | 
| boolean | contains(String name)Return whether a property source with the given name is contained. | 
| PropertySource<?> | get(String name)Return the property source with the given name,  nullif not found. | 
| Iterator<PropertySource<?>> | iterator() | 
| int | precedenceOf(PropertySource<?> propertySource)Return the precedence of the given property source,  -1if not found. | 
| PropertySource<?> | remove(String name)Remove and return the property source with the given name,  nullif not found. | 
| protected void | removeIfPresent(PropertySource<?> propertySource)Remove the given property source if it is present. | 
| void | replace(String name,
       PropertySource<?> propertySource)Replace the property source with the given name with the given property source object. | 
| int | size()Return the number of  PropertySourceobjects contained. | 
| Spliterator<PropertySource<?>> | spliterator() | 
| Stream<PropertySource<?>> | stream()Return a sequential  Streamcontaining the property sources. | 
| String | toString() | 
public MutablePropertySources()
MutablePropertySources object.public MutablePropertySources(PropertySources propertySources)
MutablePropertySources from the given propertySources
 object, preserving the original order of contained PropertySource objects.public Iterator<PropertySource<?>> iterator()
iterator in interface Iterable<PropertySource<?>>public Spliterator<PropertySource<?>> spliterator()
spliterator in interface Iterable<PropertySource<?>>public Stream<PropertySource<?>> stream()
PropertySourcesStream containing the property sources.stream in interface PropertySourcespublic boolean contains(String name)
PropertySourcescontains in interface PropertySourcesname - the name of the property source to find@Nullable public PropertySource<?> get(String name)
PropertySourcesnull if not found.get in interface PropertySourcesname - the name of the property source to findpublic void addFirst(PropertySource<?> propertySource)
public void addLast(PropertySource<?> propertySource)
public void addBefore(String relativePropertySourceName, PropertySource<?> propertySource)
public void addAfter(String relativePropertySourceName, PropertySource<?> propertySource)
public int precedenceOf(PropertySource<?> propertySource)
-1 if not found.@Nullable public PropertySource<?> remove(String name)
null if not found.name - the name of the property source to find and removepublic void replace(String name, PropertySource<?> propertySource)
name - the name of the property source to find and replacepropertySource - the replacement property sourceIllegalArgumentException - if no property source with the given name is presentcontains(java.lang.String)public int size()
PropertySource objects contained.protected void assertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource)
protected void removeIfPresent(PropertySource<?> propertySource)