Class PropertySourceUtils
- java.lang.Object
-
- com.netflix.genie.common.internal.util.PropertySourceUtils
-
public final class PropertySourceUtils extends java.lang.Object
Utilities for working with SpringPropertySource
.- Since:
- 4.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>
createPropertiesSnapshot(org.springframework.core.env.Environment environment, java.lang.String prefix)
Takes a snapshot of the properties that match a given prefix.static org.springframework.core.env.PropertySource<?>
loadYamlPropertySource(java.lang.String propertySourceName, org.springframework.core.io.Resource resource)
Load a YAMLPropertySource
from the givenresource
.
-
-
-
Method Detail
-
loadYamlPropertySource
public static org.springframework.core.env.PropertySource<?> loadYamlPropertySource(java.lang.String propertySourceName, org.springframework.core.io.Resource resource)
Load a YAMLPropertySource
from the givenresource
.- Parameters:
propertySourceName
- The name of the this property sourceresource
- The resource. Must exist and be YAML.- Returns:
- A
PropertySource
representing this set of properties
-
createPropertiesSnapshot
public static java.util.Map<java.lang.String,java.lang.String> createPropertiesSnapshot(org.springframework.core.env.Environment environment, java.lang.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
-
-