public class MutablePropertySources extends Object implements PropertySourceIterable
PropertySourceIterable interface.| 构造器和说明 |
|---|
MutablePropertySources()
Create a new
MutablePropertySources object. |
MutablePropertySources(PropertySourceIterable propertySources)
Create a new
MutablePropertySources from the given propertySources
object, preserving the original order of contained PropertySource objects. |
| 限定符和类型 | 方法和说明 |
|---|---|
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 |
containsPropertySource(String name)
Whether a property source with the given name is contained.
|
Optional<PropertySource<?>> |
getPropertySource(String name)
Find the property source with the given name,
Optional.empty() if not found. |
Iterator<PropertySource<?>> |
iterator() |
int |
precedenceOf(PropertySource<?> propertySource)
Return the precedence of the given property source,
-1 if not found. |
Optional<PropertySource<?>> |
remove(String name)
Remove and return the property source with the given name,
null if 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
PropertySource objects contained. |
Spliterator<PropertySource<?>> |
spliterator() |
Stream<PropertySource<?>> |
stream() |
String |
toString() |
public MutablePropertySources()
MutablePropertySources object.public MutablePropertySources(PropertySourceIterable propertySources)
MutablePropertySources from the given propertySources
object, preserving the original order of contained PropertySource objects.public Iterator<PropertySource<?>> iterator()
iterator 在接口中 Iterable<PropertySource<?>>public Spliterator<PropertySource<?>> spliterator()
spliterator 在接口中 Iterable<PropertySource<?>>public Stream<PropertySource<?>> stream()
stream 在接口中 PropertySourceIterablepublic boolean containsPropertySource(String name)
PropertySourceIterablecontainsPropertySource 在接口中 PropertySourceIterablename - the name of the property source to findpublic Optional<PropertySource<?>> getPropertySource(String name)
PropertySourceIterableOptional.empty() if not found.getPropertySource 在接口中 PropertySourceIterablename - 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.public Optional<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 presentcontainsPropertySource(String)public int size()
PropertySource objects contained.protected void removeIfPresent(PropertySource<?> propertySource)
protected void assertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource)
Copyright © 2021. All rights reserved.