Package com.xebialabs.xlrelease.domain

## Class Dependency

- java.lang.Object
- - com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
  - - com.xebialabs.xlrelease.domain.Dependency

- All Implemented Interfaces:
    `ConfigurationItem`, `CiWithInternalMetadata`, `java.io.Serializable`, `java.lang.Comparable<BaseConfigurationItem>`

      @Metadata(description="A dependency to another release, phase or task in a Gate task.",
                versioned=false)
      public class Dependency
      extends BaseConfigurationItem
      implements CiWithInternalMetadata

  Dependency is a link from a gate task to a plan item (release, phase or task) on which the gate depends.

  There are several possible states of a dependency:

  - Variable dependency. In this case the `targetId` contains a variable expression like ${varPhaseId}, and `target` is null.
  - Dependency with string target. In this case the `targetId` contains a plan item ID, and `target` is null.
    - It is possible that `targetId` was emptied by a public API call or by deleting a variable. Then such a dependency does not contain neither `target` nor `targetId` and will cause a Gate to fail.
  - Normal dependency. In this case the `target` field points to the plan item on which the `gateTask` depends.
  - Archived dependency. A dependency becomes "archived" when the target plan item was deleted, for example when archiving old completed releases. In this case the `target` is `null`, and the information about archived plan item is stored in fields `archivedTargetId`, `archivedTargetTitle` and `archivedAsResolved`. The latter shows if the plan item was `COMPLETED` or `ABORTED`.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `PROPERTY_TARGET` |
    `static java.lang.String` | `TYPE_DEPENDENCY` |

    - ### 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
    --- | ---
    `Dependency()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `archive()` |
    `static java.lang.String` | `createArchivedTargetTitle​(PlanItem planItem)` |
    `java.util.Map<java.lang.String,​InternalMetadata>` | `get$metadata()` |
    `java.lang.String` | `getArchivedTargetId()` |
    `java.lang.String` | `getArchivedTargetTitle()` |
    `GateTask` | `getGateTask()` |
    `<T extends PlanItem> T` | `getTarget()` |
    `java.lang.String` | `getTargetDisplayPath()` |
    `java.lang.String` | `getTargetId()` |
    `java.lang.String` | `getTargetTitle()` |
    `boolean` | `hasResolvedTarget()` |
    `boolean` | `hasValidArchiveTargetId()` |
    `boolean` | `hasVariableTarget()` |
    `boolean` | `isAborted()` |
    `boolean` | `isArchived()` |
    `boolean` | `isArchivedAsResolved()` |
    `boolean` | `isDone()` |
    `void` | `setGateTask​(GateTask gateTask)` |
    `void` | `setTarget​(PlanItem target)` |
    `void` | `setTargetId​(java.lang.String targetId)` |

    - ### 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

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

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

      `get$directoryReference, get$internalId, get$referenceId, get$securedCi, get$securedDirectoryReference, get$validationMessages, getId, getName, getProperty, getType, hasProperty, setId, setProperty`

- - ### Field Detail

    - #### TYPE_DEPENDENCY

          public static final java.lang.String TYPE_DEPENDENCY

    - #### PROPERTY_TARGET

          public static final java.lang.String PROPERTY_TARGET

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Dependency

          public Dependency()

  - ### Method Detail

    - #### getGateTask

          public GateTask getGateTask()

    - #### setGateTask

          public void setGateTask​(GateTask gateTask)

    - #### getTarget

          public <T extends PlanItem> T getTarget()

    - #### setTarget

          public void setTarget​(PlanItem target)

    - #### getTargetId

          public java.lang.String getTargetId()

    - #### setTargetId

          public void setTargetId​(java.lang.String targetId)

    - #### getArchivedTargetId

          public java.lang.String getArchivedTargetId()

    - #### getArchivedTargetTitle

          public java.lang.String getArchivedTargetTitle()

    - #### isArchived

          public boolean isArchived()

    - #### isDone

          public boolean isDone()

    - #### isAborted

          public boolean isAborted()

    - #### getTargetDisplayPath

          public java.lang.String getTargetDisplayPath()

    - #### getTargetTitle

          public java.lang.String getTargetTitle()

    - #### archive

          public void archive()

    - #### isArchivedAsResolved

          public boolean isArchivedAsResolved()

    - #### createArchivedTargetTitle

          public static java.lang.String createArchivedTargetTitle​(PlanItem planItem)

    - #### hasResolvedTarget

          public boolean hasResolvedTarget()

    - #### hasVariableTarget

          public boolean hasVariableTarget()

    - #### hasValidArchiveTargetId

          public boolean hasValidArchiveTargetId()

    - #### get$metadata

          public java.util.Map<java.lang.String,​InternalMetadata> get$metadata()

      Specified by:
        `get$metadata` in interface `CiWithInternalMetadata`