Package org.gradle.api.artifacts.dsl

# Interface DependencyConstraintFactory

@NonExtensible @Incubating @ServiceScope(org.gradle.internal.service.scopes.Scope.Build.class) public interface DependencyConstraintFactory
Factory class for creating `DependencyConstraint` instances, with strong typing.

An instance of the factory can be injected into a task, plugin or other object by annotating a public constructor or property getter method with `Inject`.

Note: This interface is not intended for implementation by build script or plugin authors.

Since:
  8.7

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DependencyConstraint`
  `create(@Nullable String group, String name, @Nullable String version)`
  Create a `DependencyConstraint` from a series of strings.
  `DependencyConstraint`
  `create(CharSequence dependencyConstraintNotation)`
  Create a `DependencyConstraint` from the `"group:name:version"` notation.
  `DependencyConstraint`
  `create(MinimalExternalModuleDependency dependency)`
  Create a `DependencyConstraint` from a `MinimalExternalModuleDependency`.
  `DependencyConstraint`
  `create(ProjectDependency project)`
  Create a `DependencyConstraint` from a `ProjectDependency`.

- ## Method Details

  - ### create

    DependencyConstraint create(CharSequence dependencyConstraintNotation)
    Create a `DependencyConstraint` from the `"group:name:version"` notation.

    Note that no classifier or extension is accepted here.

    Parameters:
      `dependencyConstraintNotation` - the dependency constraint notation
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### create

    DependencyConstraint create(@Nullable String group, String name, @Nullable String version)
    Create a `DependencyConstraint` from a series of strings.
    Parameters:
      `group` - the group (optional)
      `name` - the name
      `version` - the version (optional)
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### create

    DependencyConstraint create(MinimalExternalModuleDependency dependency)
    Create a `DependencyConstraint` from a `MinimalExternalModuleDependency`.
    Parameters:
      `dependency` - the dependency
    Returns:
      the new dependency constraint
    Since:
      8.7

  - ### create

    DependencyConstraint create(ProjectDependency project)
    Create a `DependencyConstraint` from a `ProjectDependency`.
    Parameters:
      `project` - the project dependency
    Returns:
      the new dependency constraint
    Since:
      8.7