Package com.xebialabs.xlrelease.variable

## Class VariableHelper

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

-     public class VariableHelper
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `VariableHelper()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `checkVariable​(Variable variable)` |
    `static void` | `checkVariableIdsAreTheSame​(java.lang.String requestVariableId, java.lang.String bodyVariableId)` |
    `static void` | `checkVariables​(java.util.List<Variable> variables)` |
    `static Variable` | `cloneVariable​(Variable variable, java.lang.String newKey)` |
    `static java.util.Set<java.lang.String>` | `collectVariables​(java.lang.Object input)` |
    `static scala.collection.immutable.Set<java.lang.String>` | `collectVariablesFromValue​(java.lang.Object value)` |
    `static void` | `collectVariablesInScope​(java.util.Map<java.lang.String,​Variable> allUsedVariablesMap, java.util.Map<java.lang.String,​Variable> scope, java.lang.String variableKeyToResolve)` |
    `static boolean` | `containsOnlyVariable​(java.lang.String input)` |
    `static boolean` | `containsVariables​(java.lang.String input)` |
    `static java.util.List<Variable>` | `fillVariableValues​(java.util.List<Variable> target, java.util.List<Variable> source)` |
    `static java.util.Map<java.lang.String,​java.lang.String>` | `filterOutBlankStringVariables​(java.util.Map<java.lang.String,​java.lang.String> variables)` |
    `static java.util.Map<java.lang.String,​ValueWithInterpolation>` | `filterOutBlankValues​(java.util.Map<java.lang.String,​ValueWithInterpolation> variables)` |
    `static java.lang.String` | `formatVariableIfNeeded​(java.lang.String variableName)` |
    `static java.lang.String` | `freezeUnresolvedVariable​(java.lang.String input, java.lang.String variableName)` |
    `static java.util.HashMap<java.lang.String,​Variable>` | `getAllReleaseVariablesByKeys​(Release release)` |
    `static java.util.Map<java.lang.String,​PasswordStringVariable>` | `getExternalVariables​(java.util.List<Variable> variables)` |
    `static java.util.Map<java.lang.String,​java.lang.String>` | `getPasswordVariableValuesAsStrings​(java.util.List<Variable> vars)` |
    `static java.util.Map<java.lang.String,​PasswordStringVariable>` | `getUsedExternalPasswordVariables​(Release release)` |
    `static java.util.Map<java.lang.String,​java.lang.String>` | `getUsedStringVariables​(Release release)` |
    `static java.util.Map<java.lang.String,​java.lang.String>` | `getVariableValuesAsStrings​(java.util.List<Variable> vars)` |
    `static java.util.Map<java.lang.String,​Variable>` | `indexByKey​(java.util.List<Variable> variables)` |
    `static boolean` | `isCiPropertyVariable​(java.lang.String variableName)` | Shows if a variable looks like a ${release.something}.
    `static boolean` | `isFolderVariable​(java.lang.String variableName)` |
    `static boolean` | `isGlobalOrFolderVariable​(java.lang.String variableName)` |
    `static boolean` | `isGlobalVariable​(java.lang.String variableName)` |
    `static boolean` | `isGlobalVariableId​(java.lang.String id)` |
    `static java.lang.String` | `replaceAll​(java.lang.String raw, java.util.Map<java.lang.String,​java.lang.String> replacements)` |
    `static <T> T` | `replaceAll​(T raw, java.util.Map<java.lang.String,​java.lang.String> replacements, java.util.Set<java.lang.String> unresolvedVariables, boolean freezeEvenIfUnresolved)` |
    `static <T> T` | `replaceAllWithInterpolation​(T raw, java.util.Map<java.lang.String,​ValueWithInterpolation> replacements, java.util.Set<java.lang.String> unresolvedVariables, boolean freezeEvenIfUnresolved)` |
    `static java.lang.String` | `safeReplace​(java.lang.String input, java.lang.String key, java.lang.String replacement)` |
    `static java.lang.String` | `toString​(java.lang.Object untyped)` |
    `static java.util.regex.Pattern` | `VARIABLE_NAME_PATTERN()` |
    `static java.lang.String` | `withoutVariableSyntax​(java.lang.String variableKey)` |
    `static java.lang.String` | `withVariableSyntax​(java.lang.String variableName)` |

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

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

- - ### Constructor Detail

    - #### VariableHelper

          public VariableHelper()

  - ### Method Detail

    - #### VARIABLE_NAME_PATTERN

          public static java.util.regex.Pattern VARIABLE_NAME_PATTERN()

    - #### safeReplace

          public static java.lang.String safeReplace​(java.lang.String input,
                                                     java.lang.String key,
                                                     java.lang.String replacement)

    - #### isCiPropertyVariable

          public static boolean isCiPropertyVariable​(java.lang.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​(java.lang.String variableName)

    - #### isFolderVariable

          public static boolean isFolderVariable​(java.lang.String variableName)

    - #### isGlobalOrFolderVariable

          public static boolean isGlobalOrFolderVariable​(java.lang.String variableName)

    - #### containsVariables

          public static boolean containsVariables​(java.lang.String input)

    - #### formatVariableIfNeeded

          public static java.lang.String formatVariableIfNeeded​(java.lang.String variableName)

    - #### containsOnlyVariable

          public static boolean containsOnlyVariable​(java.lang.String input)

    - #### withVariableSyntax

          public static java.lang.String withVariableSyntax​(java.lang.String variableName)

    - #### withoutVariableSyntax

          public static java.lang.String withoutVariableSyntax​(java.lang.String variableKey)

    - #### checkVariable

          public static void checkVariable​(Variable variable)

    - #### checkVariables

          public static void checkVariables​(java.util.List<Variable> variables)

    - #### getExternalVariables

          public static java.util.Map<java.lang.String,​PasswordStringVariable> getExternalVariables​(java.util.List<Variable> variables)

    - #### indexByKey

          public static java.util.Map<java.lang.String,​Variable> indexByKey​(java.util.List<Variable> variables)

    - #### checkVariableIdsAreTheSame

          public static void checkVariableIdsAreTheSame​(java.lang.String requestVariableId,
                                                        java.lang.String bodyVariableId)

    - #### isGlobalVariableId

          public static boolean isGlobalVariableId​(java.lang.String id)

    - #### fillVariableValues

          public static java.util.List<Variable> fillVariableValues​(java.util.List<Variable> target,
                                                                    java.util.List<Variable> source)

    - #### cloneVariable

          public static Variable cloneVariable​(Variable variable,
                                               java.lang.String newKey)

    - #### filterOutBlankStringVariables

          public static java.util.Map<java.lang.String,​java.lang.String> filterOutBlankStringVariables​(java.util.Map<java.lang.String,​java.lang.String> variables)

    - #### filterOutBlankValues

          public static java.util.Map<java.lang.String,​ValueWithInterpolation> filterOutBlankValues​(java.util.Map<java.lang.String,​ValueWithInterpolation> variables)

    - #### getAllReleaseVariablesByKeys

          public static java.util.HashMap<java.lang.String,​Variable> getAllReleaseVariablesByKeys​(Release release)

    - #### toString

          public static java.lang.String toString​(java.lang.Object untyped)

    - #### replaceAll

          public static java.lang.String replaceAll​(java.lang.String raw,
                                                    java.util.Map<java.lang.String,​java.lang.String> replacements)

    - #### replaceAll

          public static <T> T replaceAll​(T raw,
                                         java.util.Map<java.lang.String,​java.lang.String> replacements,
                                         java.util.Set<java.lang.String> unresolvedVariables,
                                         boolean freezeEvenIfUnresolved)

    - #### replaceAllWithInterpolation

          public static <T> T replaceAllWithInterpolation​(T raw,
                                                          java.util.Map<java.lang.String,​ValueWithInterpolation> replacements,
                                                          java.util.Set<java.lang.String> unresolvedVariables,
                                                          boolean freezeEvenIfUnresolved)

    - #### getVariableValuesAsStrings

          public static java.util.Map<java.lang.String,​java.lang.String> getVariableValuesAsStrings​(java.util.List<Variable> vars)

    - #### getPasswordVariableValuesAsStrings

          public static java.util.Map<java.lang.String,​java.lang.String> getPasswordVariableValuesAsStrings​(java.util.List<Variable> vars)

    - #### freezeUnresolvedVariable

          public static java.lang.String freezeUnresolvedVariable​(java.lang.String input,
                                                                  java.lang.String variableName)

    - #### collectVariables

          public static java.util.Set<java.lang.String> collectVariables​(java.lang.Object input)

    - #### collectVariablesFromValue

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

    - #### getUsedExternalPasswordVariables

          public static java.util.Map<java.lang.String,​PasswordStringVariable> getUsedExternalPasswordVariables​(Release release)

    - #### getUsedStringVariables

          public static java.util.Map<java.lang.String,​java.lang.String> getUsedStringVariables​(Release release)

    - #### collectVariablesInScope

          public static void collectVariablesInScope​(java.util.Map<java.lang.String,​Variable> allUsedVariablesMap,
                                                     java.util.Map<java.lang.String,​Variable> scope,
                                                     java.lang.String variableKeyToResolve)