org.apache.ivy.core.module.descriptor

## Class OverrideDependencyDescriptorMediator

- java.lang.Object
- - org.apache.ivy.core.module.descriptor.OverrideDependencyDescriptorMediator

- All Implemented Interfaces:
    DependencyDescriptorMediator

      public class OverrideDependencyDescriptorMediator
      extends java.lang.Object
      implements DependencyDescriptorMediator

  DependencyDescriptorMediator used to override some dependency descriptors values, such as the branch or version of the dependency.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OverrideDependencyDescriptorMediator(java.lang.String branch, java.lang.String version)` Constructs a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBranch()` Returns the branch this mediator will give to mediated descriptors, or `null` if this mediator does not override branch.
    `java.lang.String` | `getVersion()` Returns the version this mediator will give to mediated descriptors, or `null` if this mediator does not override version.
    `DependencyDescriptor` | `mediate(DependencyDescriptor dd)` Mediates the given `DependencyDescriptor` according to this `ModuleDescriptor`.

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

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

- - ### Constructor Detail

    - #### OverrideDependencyDescriptorMediator

          public OverrideDependencyDescriptorMediator(java.lang.String branch,
                                              java.lang.String version)

      Constructs a new instance.
      Parameters:
        `branch` - the branch to give to mediated dependency descriptors, `null` to keep the original branch.
        `version` - the version to give to mediated dependency descriptors, `null` to keep the original one.

  - ### Method Detail

    - #### getVersion

          public java.lang.String getVersion()

      Returns the version this mediator will give to mediated descriptors, or `null` if this mediator does not override version.
      Returns:
        the version this mediator will give to mediated descriptors.

    - #### getBranch

          public java.lang.String getBranch()

      Returns the branch this mediator will give to mediated descriptors, or `null` if this mediator does not override branch.
      Returns:
        the branch this mediator will give to mediated descriptors.

    - #### mediate

          public DependencyDescriptor mediate(DependencyDescriptor dd)

      Description copied from interface: `DependencyDescriptorMediator`
      Mediates the given `DependencyDescriptor` according to this `ModuleDescriptor`.

      This method gives the opportunity to a ModuleDescriptor to override dependency version information of any of its transitive dependencies, since it is called by dependency resolvers before actually resolving a dependency.

      Specified by:
        `mediate` in interface `DependencyDescriptorMediator`
      Parameters:
        `dd` - the dependency descriptor which should be mediated.
      Returns:
        the mediated `DependencyDescriptor`, or the original `DependencyDescriptor` if no mediation is required by this ModuleDescriptor.