Class Environment
java.lang.Object
org.springframework.cloud.config.environment.Environment
Simple plain text serializable encapsulation of a list of property sources. Basically a
DTO for
Environment, but also applicable outside
the domain of a Spring application.- Author:
- Dave Syer, Spencer Gibb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String"(_)" is uncommon in a git repo name, but "/" cannot be matched by Spring MVC. -
Constructor Summary
ConstructorsConstructorDescriptionEnvironment(String name, String... profiles) Environment(Environment env) Copies all fields except propertySources. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PropertySource propertySource) voidaddAll(List<PropertySource> propertySources) voidaddFirst(PropertySource propertySource) static StringUtility method for denormalizing names and labels.getLabel()getName()String[]getState()static StringUtility method for normalizing names and labels.voidvoidvoidsetProfiles(String[] profiles) voidvoidsetVersion(String version) toString()
-
Field Details
-
SLASH_PLACEHOLDER
"(_)" is uncommon in a git repo name, but "/" cannot be matched by Spring MVC.- See Also:
-
-
Constructor Details
-
Environment
-
Environment
Copies all fields except propertySources.- Parameters:
env- Spring Environment
-
Environment
-
-
Method Details
-
normalize
Utility method for normalizing names and labels.- Parameters:
s- String to normalize.- Returns:
- if s contains (_), replace with slash.
-
denormalize
Utility method for denormalizing names and labels.- Parameters:
s- String to denormalize.- Returns:
- if s contains slash, replace with (_).
-
add
-
addAll
-
addFirst
-
getPropertySources
-
getName
-
setName
-
getLabel
-
setLabel
-
getProfiles
-
setProfiles
-
getVersion
-
setVersion
-
getState
-
setState
-
toString
-