Package com.xebialabs.xlrelease.variable
Class VariableHelper
java.lang.Object
com.xebialabs.xlrelease.variable.VariableHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkVariable
(Variable variable) static void
checkVariableIdsAreTheSame
(String requestVariableId, String bodyVariableId) static void
checkVariables
(List<Variable> variables) static Variable
cloneVariable
(Variable variable, String newKey) collectVariables
(Object input) static scala.collection.immutable.Set<String>
collectVariablesFromValue
(Object value) static void
collectVariablesInScope
(Map<String, Variable> allUsedVariablesMap, Map<String, Variable> scope, String variableKeyToResolve) static boolean
containsOnlyVariable
(String input) static boolean
containsVariables
(String input) fillVariableValues
(List<Variable> target, List<Variable> source) filterOutBlankStringVariables
(Map<String, String> variables) static Map<String,
ValueWithInterpolation> filterOutBlankValues
(Map<String, ValueWithInterpolation> variables) static String
formatVariableIfNeeded
(String variableName) static String
freezeUnresolvedVariable
(String input, String variableName) getAllReleaseVariablesByKeys
(Release release) static Map<String,
PasswordStringVariable> getExternalVariables
(List<Variable> variables) static Map<String,
PasswordStringVariable> getUsedExternalPasswordVariables
(Release release) getUsedStringVariables
(PlanItem planItem) indexByKey
(List<Variable> variables) static boolean
isCiPropertyVariable
(String variableName) Shows if a variable looks like a ${release.something}.static boolean
isFolderVariable
(String variableName) static boolean
isGlobalOrFolderVariable
(String variableName) static boolean
isGlobalVariable
(String variableName) static boolean
static String
replaceAll
(String raw, Map<String, String> replacements) static <T> T
replaceAll
(T raw, Map<String, String> replacements, Set<String> unresolvedVariables, boolean freezeEvenIfUnresolved) static <T> T
replaceAllWithInterpolation
(T raw, Map<String, ValueWithInterpolation> replacements, Set<String> unresolvedVariables, boolean freezeEvenIfUnresolved) static String
safeReplace
(String input, String key, String replacement) static String
static Pattern
static String
withoutVariableSyntax
(String variableKey) static String
withVariableSyntax
(String variableName)
-
Constructor Details
-
VariableHelper
public VariableHelper()
-
-
Method Details
-
VARIABLE_NAME_PATTERN
-
safeReplace
-
isCiPropertyVariable
Shows if a variable looks like a ${release.something}. Note that it will return "true" also for names like ${release.custom} for whichcom.xebialabs.xlrelease.domain.variables.reference.ReleasePropertyVariableKey.isReleasePropertyVariableKey()
would return "false". We discourage using such variables but they may exist in older installations.- Parameters:
variableName
- (undocumented)- Returns:
- (undocumented)
-
isGlobalVariable
-
isFolderVariable
-
isGlobalOrFolderVariable
-
containsVariables
-
formatVariableIfNeeded
-
containsOnlyVariable
-
withVariableSyntax
-
withoutVariableSyntax
-
checkVariable
-
checkVariables
-
getExternalVariables
-
indexByKey
-
checkVariableIdsAreTheSame
-
isGlobalVariableId
-
fillVariableValues
-
cloneVariable
-
filterOutBlankStringVariables
-
filterOutBlankValues
public static Map<String,ValueWithInterpolation> filterOutBlankValues(Map<String, ValueWithInterpolation> variables) -
getAllReleaseVariablesByKeys
-
toString
-
replaceAll
-
replaceAll
-
replaceAllWithInterpolation
public static <T> T replaceAllWithInterpolation(T raw, Map<String, ValueWithInterpolation> replacements, Set<String> unresolvedVariables, boolean freezeEvenIfUnresolved) -
getVariableValuesAsStrings
-
getPasswordVariableValuesAsStrings
-
freezeUnresolvedVariable
-
collectVariables
-
collectVariablesFromValue
-
getUsedExternalPasswordVariables
-
getUsedStringVariables
-
collectVariablesInScope
-