Package com.xebialabs.xlrelease.domain.variables

## Class Variable

- java.lang.Object
- - com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
  - - com.xebialabs.xlrelease.domain.BaseConfiguration
    - - com.xebialabs.xlrelease.domain.variables.Variable

- All Implemented Interfaces:
    `ConfigurationItem`, `VisitableItem`, `java.io.Serializable`, `java.lang.Cloneable`, `java.lang.Comparable<BaseConfigurationItem>`
  Direct Known Subclasses:
    `Variable.VariableWithValue`

      @Metadata(virtual=true,
                versioned=false)
      public abstract class Variable
      extends BaseConfiguration
      implements java.lang.Cloneable, VisitableItem

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `Variable.VariableWithValue<V>` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.lang.String` | `description` |
    `protected boolean` | `inherited` |
    `protected java.lang.String` | `key` |
    `protected java.lang.String` | `label` |
    `protected boolean` | `requiresValue` |
    `protected boolean` | `showOnReleaseStart` |
    `protected ValueProviderConfiguration` | `valueProvider` |

    - ### Fields inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem

      `id, syntheticProperties, type`

    - ### Fields inherited from interface com.xebialabs.deployit.plugin.api.udm.ConfigurationItem

      `SYNTHETIC_PROPERTIES_FIELD, TYPE_FIELD`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `accept​(ReleaseVisitor visitor)` |
    `void` | `checkFolderVariableValidity()` |
    `void` | `checkGlobalVariableValidity()` |
    `void` | `checkValidity()` |
    `Variable` | `clone()` |
    `protected java.lang.String` | `escapeQuotes​(java.lang.String value)` |
    `java.lang.String` | `getDescription()` |
    `abstract java.lang.Object` | `getEmptyValue()` | Returns empty value for the specific sub type.
    `abstract java.lang.String` | `getEmptyValueAsString()` |
    `java.lang.String` | `getKey()` |
    `java.lang.String` | `getLabel()` |
    `boolean` | `getRequiresValue()` |
    `boolean` | `getShowOnReleaseStart()` |
    `abstract java.lang.Object` | `getValue()` | Gets underlying value of this variable, or default value for templates.
    `abstract java.lang.String` | `getValueAsString()` |
    `ValueProviderConfiguration` | `getValueProvider()` |
    `boolean` | `isInherited()` |
    `abstract boolean` | `isPassword()` |
    `abstract boolean` | `isValueAssignableFrom​(java.lang.Object value)` |
    `boolean` | `isValueEmpty()` | Test if value is unset or empty.
    `void` | `setDescription​(java.lang.String description)` |
    `void` | `setInherited​(boolean inherited)` |
    `void` | `setKey​(java.lang.String key)` |
    `void` | `setLabel​(java.lang.String label)` |
    `void` | `setRequiresValue​(boolean requiresValue)` |
    `void` | `setShowOnReleaseStart​(boolean showOnReleaseStart)` |
    `abstract void` | `setUntypedValue​(java.lang.Object newValue)` | Sets the underlying value of this variable from given object.
    `void` | `setValueProvider​(ValueProviderConfiguration valueProvider)` |

    - ### Methods inherited from class com.xebialabs.xlrelease.domain.BaseConfiguration

      `getFolderId, getTitle, hasId, setFolderId, setTitle`

    - ### Methods inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem

      `compareTo, equals, get$ciAttributes, get$directoryReference, get$externalProperties, get$internalId, get$referenceId, get$securedCi, get$securedDirectoryReference, get$token, get$validationMessages, getId, getName, getProperty, getPropertyDescriptor, getType, hashCode, hasProperty, set$ciAttributes, set$directoryReference, set$externalProperties, set$internalId, set$referenceId, set$securedCi, set$securedDirectoryReference, set$token, set$validationMessages, setId, setProperty, setType, toString`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### key

          @Property(description="The unique name of the variable in the way it is used in template or release, without curly braces")
          protected java.lang.String key

    - #### requiresValue

          @Property(required=false,
                    defaultValue="true",
                    description="Shows if an empty value is a valid value for this variable")
          protected boolean requiresValue

    - #### showOnReleaseStart

          @Property(required=false,
                    defaultValue="true",
                    description="Shows if this variable will be shown on create release page")
          protected boolean showOnReleaseStart

    - #### label

          @Property(required=false,
                    description="Label of the variable")
          protected java.lang.String label

    - #### description

          @Property(required=false,
                    description="Description of the variable")
          protected java.lang.String description

    - #### valueProvider

          @Property(required=false,
                    description="Configuration of the variable values provider")
          protected ValueProviderConfiguration valueProvider

    - #### inherited

          @Property(required=false,
                    description="Determines whether the variable value is inherited from the template variable. Used in the Create Release Task only.")
          protected boolean inherited

  - ### Constructor Detail

    - #### Variable

          public Variable()

  - ### Method Detail

    - #### getValue

          public abstract java.lang.Object getValue()

      Gets underlying value of this variable, or default value for templates. The specific type of value depends on the type of variable.
      Returns:
        the underlying value of this variable, or default value for templates.

    - #### getEmptyValue

          public abstract java.lang.Object getEmptyValue()

      Returns empty value for the specific sub type. Empty value is used when replacing unset optional variables.
      Returns:
        empty value for the specific sub type.

    - #### isValueEmpty

          public boolean isValueEmpty()

      Test if value is unset or empty. Rely on the `getEmptyValue()` implementation.
      Returns:
        true if value is null or empty.

    - #### setUntypedValue

          public abstract void setUntypedValue​(java.lang.Object newValue)
                                        throws java.lang.IllegalArgumentException

      Sets the underlying value of this variable from given object. If a conversion happens to be needed and fails, then an `IllegalArgumentException` will be thrown.
      Parameters:
        `newValue` - the value to set: either of the type needed by this variable type, or one of convertible types.
      Throws:
        `java.lang.IllegalArgumentException` - if conversion of the value fails.

    - #### getKey

          public java.lang.String getKey()

    - #### setKey

          public void setKey​(java.lang.String key)

    - #### getRequiresValue

          public boolean getRequiresValue()

    - #### setRequiresValue

          public void setRequiresValue​(boolean requiresValue)

    - #### getShowOnReleaseStart

          public boolean getShowOnReleaseStart()

    - #### setShowOnReleaseStart

          public void setShowOnReleaseStart​(boolean showOnReleaseStart)

    - #### getLabel

          public java.lang.String getLabel()

    - #### setLabel

          public void setLabel​(java.lang.String label)

    - #### getDescription

          public java.lang.String getDescription()

    - #### setDescription

          public void setDescription​(java.lang.String description)

    - #### checkValidity

          public void checkValidity()

    - #### checkGlobalVariableValidity

          public void checkGlobalVariableValidity()

    - #### checkFolderVariableValidity

          public void checkFolderVariableValidity()

    - #### isPassword

          public abstract boolean isPassword()

    - #### getValueAsString

          public abstract java.lang.String getValueAsString()

    - #### getEmptyValueAsString

          public abstract java.lang.String getEmptyValueAsString()

    - #### isValueAssignableFrom

          public abstract boolean isValueAssignableFrom​(java.lang.Object value)

    - #### escapeQuotes

          protected java.lang.String escapeQuotes​(java.lang.String value)

    - #### getValueProvider

          public ValueProviderConfiguration getValueProvider()

    - #### setValueProvider

          public void setValueProvider​(ValueProviderConfiguration valueProvider)

    - #### accept

          public void accept​(ReleaseVisitor visitor)

      Specified by:
        `accept` in interface `VisitableItem`

    - #### isInherited

          public boolean isInherited()

    - #### setInherited

          public void setInherited​(boolean inherited)

    - #### clone

          public Variable clone()
                         throws java.lang.CloneNotSupportedException

      Overrides:
        `clone` in class `java.lang.Object`
      Throws:
        `java.lang.CloneNotSupportedException`