Package ru.vyarus.yaml.updater.update
Class EnvSupport
- java.lang.Object
-
- ru.vyarus.yaml.updater.update.EnvSupport
-
public class EnvSupport extends java.lang.ObjectEnvironment variables could be used to personalize updating yaml file. For example:some: - prop: #{var}Such syntax allows yaml parser to treat variable as a comment (if it would not be replaced). Also, variables in format
${va}are often used directly in the configuration (to be replaced at runtime with environment variables).Variable names are case-sensitive. Unknown variables are not replaced. Null values replaced with empty.
- Since:
- 08.06.2021
-
-
Constructor Summary
Constructors Constructor Description EnvSupport(java.lang.String prefix, java.lang.String postfix, java.util.Map<java.lang.String,java.lang.String> env)EnvSupport(java.util.Map<java.lang.String,java.lang.String> env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringapply(java.lang.String text)Replace variables in the provided text.java.util.Map<java.lang.String,java.lang.String>getApplied()
-
-
-
Method Detail
-
apply
public java.lang.String apply(java.lang.String text)
Replace variables in the provided text.- Parameters:
text- text to process- Returns:
- text with replaced known variables
-
getApplied
public java.util.Map<java.lang.String,java.lang.String> getApplied()
- Returns:
- applied variables in the latest execution or empty map
-
-