DependencyConstraintHandler (Gradle API 8.11)

Package org.gradle.api.artifacts.dsl

## Interface DependencyConstraintHandler

-     public interface DependencyConstraintHandler

  A `DependencyConstraintHandler` is used to declare dependency constraints.

  Since:
    4.5

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DependencyConstraint` | `add​(java.lang.String configurationName, java.lang.Object dependencyConstraintNotation)` | Adds a dependency constraint to the given configuration.
    `DependencyConstraint` | `add​(java.lang.String configurationName, java.lang.Object dependencyNotation, Action<? super DependencyConstraint> configureAction)` | Adds a dependency constraint to the given configuration, and configures the dependency constraint using the given closure.
    `DependencyConstraint` | `create​(java.lang.Object dependencyConstraintNotation)` | Creates a dependency constraint without adding it to a configuration.
    `DependencyConstraint` | `create​(java.lang.Object dependencyConstraintNotation, Action<? super DependencyConstraint> configureAction)` | Creates a dependency constraint without adding it to a configuration, and configures the dependency constraint using the given closure.
    `DependencyConstraint` | `enforcedPlatform​(java.lang.Object notation)` | Declares a constraint on an enforced platform.
    `DependencyConstraint` | `enforcedPlatform​(java.lang.Object notation, Action<? super DependencyConstraint> configureAction)` | Declares a constraint on an enforced platform.

- - ### Method Detail

    - #### add

          DependencyConstraint add​(java.lang.String configurationName,
                                   java.lang.Object dependencyConstraintNotation)

      Adds a dependency constraint to the given configuration.
      Parameters:
        `configurationName` - The name of the configuration.
        `dependencyConstraintNotation` - the constraint

    - #### add

          DependencyConstraint add​(java.lang.String configurationName,
                                   java.lang.Object dependencyNotation,
                                   Action<? super DependencyConstraint> configureAction)

      Adds a dependency constraint to the given configuration, and configures the dependency constraint using the given closure.
      Parameters:
        `configurationName` - The name of the configuration.
        `dependencyNotation` - The dependency constraint notation
        `configureAction` - The closure to use to configure the dependency constraint.

    - #### create

          DependencyConstraint create​(java.lang.Object dependencyConstraintNotation)

      Creates a dependency constraint without adding it to a configuration.
      Parameters:
        `dependencyConstraintNotation` - The dependency constraint notation.

    - #### create

          DependencyConstraint create​(java.lang.Object dependencyConstraintNotation,
                                      Action<? super DependencyConstraint> configureAction)

      Creates a dependency constraint without adding it to a configuration, and configures the dependency constraint using the given closure.
      Parameters:
        `dependencyConstraintNotation` - The dependency constraint notation.
        `configureAction` - The closure to use to configure the dependency.

    - #### enforcedPlatform

          DependencyConstraint enforcedPlatform​(java.lang.Object notation)

      Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.
      Parameters:
        `notation` - the coordinates of the platform
      Since:
        5.0

    - #### enforcedPlatform

          DependencyConstraint enforcedPlatform​(java.lang.Object notation,
                                                Action<? super DependencyConstraint> configureAction)

      Declares a constraint on an enforced platform. If the target coordinates represent multiple potential components, the platform component will be selected, instead of the library. An enforced platform is a platform for which the direct dependencies are forced, meaning that they would override any other version found in the graph.
      Parameters:
        `notation` - the coordinates of the platform
        `configureAction` - the dependency configuration block
      Since:
        5.0