Class PropertySourceUtils
java.lang.Object
com.netflix.genie.common.internal.util.PropertySourceUtils
Utilities for working with Spring
PropertySource.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreatePropertiesSnapshot(org.springframework.core.env.Environment environment, String prefix) Takes a snapshot of the properties that match a given prefix.static org.springframework.core.env.PropertySource<?>loadYamlPropertySource(String propertySourceName, org.springframework.core.io.Resource resource) Load a YAMLPropertySourcefrom the givenresource.
-
Method Details
-
loadYamlPropertySource
public static org.springframework.core.env.PropertySource<?> loadYamlPropertySource(String propertySourceName, org.springframework.core.io.Resource resource) Load a YAMLPropertySourcefrom the givenresource.- Parameters:
propertySourceName- The name of the this property sourceresource- The resource. Must exist and be YAML.- Returns:
- A
PropertySourcerepresenting this set of properties
-
createPropertiesSnapshot
public static Map<String,String> createPropertiesSnapshot(org.springframework.core.env.Environment environment, String prefix) Takes a snapshot of the properties that match a given prefix. The prefix is stripped from the property name. Properties with empty and null values are not included.- Parameters:
environment- the environmentprefix- the prefix to match- Returns:
- an immutable map of property name and property value in string form
-