Package com.xebialabs.xlrelease.variable

# Class VariableHelper

java.lang.Object
com.xebialabs.xlrelease.variable.VariableHelper

public class VariableHelper extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableHelper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `checkVariable(Variable variable)`
  `static void`
  `checkVariableIdsAreTheSame(String requestVariableId, String bodyVariableId)`
  `static void`
  `checkVariables(List<Variable> variables)`
  `static Variable`
  `cloneVariable(Variable variable, String newKey)`
  `static Set<String>`
  `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)`
  `static List<Variable>`
  `fillVariableValues(List<Variable> target, List<Variable> source)`
  `static Map<String,String>`
  `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)`
  `static HashMap<String,Variable>`
  `getAllReleaseVariablesByKeys(Release release)`
  `static Map<String,PasswordStringVariable>`
  `getExternalVariables(List<Variable> variables)`
  `static Map<String,String>`
  `getPasswordVariableValuesAsStrings(List<Variable> vars)`
  `static Map<String,PasswordStringVariable>`
  `getUsedExternalPasswordVariables(Release release)`
  `static Map<String,String>`
  `getUsedStringVariables(Release release)`
  `static Map<String,String>`
  `getVariableValuesAsStrings(List<Variable> vars)`
  `static Map<String,Variable>`
  `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`
  `isGlobalVariableId(String id)`
  `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`
  `toString(Object untyped)`
  `static Pattern`
  `VARIABLE_NAME_PATTERN()`
  `static String`
  `withoutVariableSyntax(String variableKey)`
  `static String`
  `withVariableSyntax(String variableName)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VariableHelper

    public VariableHelper()

- ## Method Details

  - ### VARIABLE_NAME_PATTERN

    public static Pattern VARIABLE_NAME_PATTERN()

  - ### safeReplace

    public static String safeReplace(String input, String key, String replacement)

  - ### isCiPropertyVariable

    public static boolean isCiPropertyVariable(String variableName)
    Shows if a variable looks like a ${release.something}. Note that it will return "true" also for names like ${release.custom} for which `com.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

    public static boolean isGlobalVariable(String variableName)

  - ### isFolderVariable

    public static boolean isFolderVariable(String variableName)

  - ### isGlobalOrFolderVariable

    public static boolean isGlobalOrFolderVariable(String variableName)

  - ### containsVariables

    public static boolean containsVariables(String input)

  - ### formatVariableIfNeeded

    public static String formatVariableIfNeeded(String variableName)

  - ### containsOnlyVariable

    public static boolean containsOnlyVariable(String input)

  - ### withVariableSyntax

    public static String withVariableSyntax(String variableName)

  - ### withoutVariableSyntax

    public static String withoutVariableSyntax(String variableKey)

  - ### checkVariable

    public static void checkVariable(Variable variable)

  - ### checkVariables

    public static void checkVariables(List<Variable> variables)

  - ### getExternalVariables

    public static Map<String,PasswordStringVariable> getExternalVariables(List<Variable> variables)

  - ### indexByKey

    public static Map<String,Variable> indexByKey(List<Variable> variables)

  - ### checkVariableIdsAreTheSame

    public static void checkVariableIdsAreTheSame(String requestVariableId, String bodyVariableId)

  - ### isGlobalVariableId

    public static boolean isGlobalVariableId(String id)

  - ### fillVariableValues

    public static List<Variable> fillVariableValues(List<Variable> target, List<Variable> source)

  - ### cloneVariable

    public static Variable cloneVariable(Variable variable, String newKey)

  - ### filterOutBlankStringVariables

    public static Map<String,String> filterOutBlankStringVariables(Map<String,String> variables)

  - ### filterOutBlankValues

    public static Map<String,ValueWithInterpolation> filterOutBlankValues(Map<String,ValueWithInterpolation> variables)

  - ### getAllReleaseVariablesByKeys

    public static HashMap<String,Variable> getAllReleaseVariablesByKeys(Release release)

  - ### toString

    public static String toString(Object untyped)

  - ### replaceAll

    public static String replaceAll(String raw, Map<String,String> replacements)

  - ### replaceAll

    public static <T> T replaceAll(T raw, Map<String,String> replacements, Set<String> unresolvedVariables, boolean freezeEvenIfUnresolved)

  - ### replaceAllWithInterpolation

    public static <T> T replaceAllWithInterpolation(T raw, Map<String,ValueWithInterpolation> replacements, Set<String> unresolvedVariables, boolean freezeEvenIfUnresolved)

  - ### getVariableValuesAsStrings

    public static Map<String,String> getVariableValuesAsStrings(List<Variable> vars)

  - ### getPasswordVariableValuesAsStrings

    public static Map<String,String> getPasswordVariableValuesAsStrings(List<Variable> vars)

  - ### freezeUnresolvedVariable

    public static String freezeUnresolvedVariable(String input, String variableName)

  - ### collectVariables

    public static Set<String> collectVariables(Object input)

  - ### collectVariablesFromValue

    public static scala.collection.immutable.Set<String> collectVariablesFromValue(Object value)

  - ### getUsedExternalPasswordVariables

    public static Map<String,PasswordStringVariable> getUsedExternalPasswordVariables(Release release)

  - ### getUsedStringVariables

    public static Map<String,String> getUsedStringVariables(Release release)

  - ### collectVariablesInScope

    public static void collectVariablesInScope(Map<String,Variable> allUsedVariablesMap, Map<String,Variable> scope, String variableKeyToResolve)