Class DefaultPropertiesPropertySource
public class DefaultPropertiesPropertySource
extends org.springframework.core.env.MapPropertySource
MapPropertySource containing default properties contributed directly to a
 SpringApplication. By convention, the DefaultPropertiesPropertySource
 is always the last property source in the Environment.- Since:
- 2.4.0
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.core.env.PropertySourceorg.springframework.core.env.PropertySource.StubPropertySource
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe name of the 'default properties' property source.Fields inherited from class org.springframework.core.env.PropertySourcelogger, name, source
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultPropertiesPropertySource(Map<String, Object> source) Create a newDefaultPropertiesPropertySourcewith the givenMapsource.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddOrMerge(Map<String, Object> source, org.springframework.core.env.MutablePropertySources sources) Add a newDefaultPropertiesPropertySourceor merge with an existing one.static booleanhasMatchingName(@Nullable org.springframework.core.env.PropertySource<?> propertySource) Returntrueif the given source is named 'defaultProperties'.static voidifNotEmpty(Map<String, Object> source, @Nullable Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySourceinstance if the provided source is not empty.static voidmoveToEnd(org.springframework.core.env.ConfigurableEnvironment environment) Move the 'defaultProperties' property source so that it's the last source in the givenConfigurableEnvironment.static voidmoveToEnd(org.springframework.core.env.MutablePropertySources propertySources) Move the 'defaultProperties' property source so that it's the last source in the givenMutablePropertySources.Methods inherited from class org.springframework.core.env.MapPropertySourcecontainsProperty, getProperty, getPropertyNamesMethods inherited from class org.springframework.core.env.PropertySourceequals, getName, getSource, hashCode, named, toString
- 
Field Details- 
NAME
 
- 
- 
Constructor Details- 
DefaultPropertiesPropertySourceCreate a newDefaultPropertiesPropertySourcewith the givenMapsource.- Parameters:
- source- the source map
 
 
- 
- 
Method Details- 
hasMatchingNamepublic static boolean hasMatchingName(@Nullable org.springframework.core.env.PropertySource<?> propertySource) Returntrueif the given source is named 'defaultProperties'.- Parameters:
- propertySource- the property source to check
- Returns:
- trueif the name matches
 
- 
ifNotEmptypublic static void ifNotEmpty(Map<String, Object> source, @Nullable Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySourceinstance if the provided source is not empty.- Parameters:
- source- the- Mapsource
- action- the action used to consume the- DefaultPropertiesPropertySource
 
- 
addOrMergepublic static void addOrMerge(Map<String, Object> source, org.springframework.core.env.MutablePropertySources sources) Add a newDefaultPropertiesPropertySourceor merge with an existing one.- Parameters:
- source- the- Mapsource
- sources- the existing sources
- Since:
- 2.4.4
 
- 
moveToEndpublic static void moveToEnd(org.springframework.core.env.ConfigurableEnvironment environment) Move the 'defaultProperties' property source so that it's the last source in the givenConfigurableEnvironment.- Parameters:
- environment- the environment to update
 
- 
moveToEndpublic static void moveToEnd(org.springframework.core.env.MutablePropertySources propertySources) Move the 'defaultProperties' property source so that it's the last source in the givenMutablePropertySources.- Parameters:
- propertySources- the property sources to update
 
 
-