org.gradle.api.artifacts

## Interface VersionConstraint

- All Known Subinterfaces:
    MutableVersionConstraint

      @Incubating
      public interface VersionConstraint

  Represents a constrained version. By default, when a dependency has a version number, it is assumed that the version can be upgraded during conflict resolution (typically, version 1.15 can be upgraded to 1.16). However in some cases we don't want this behavior. This class represents the base spec of module constraints.
  Since:
    4.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBranch()` The branch to select versions from.
    `String` | `getPreferredVersion()` The preferred version of a module.
    `List<String>` | `getRejectedVersions()` Returns the list of versions that this module rejects (which may be exact versions, or ranges, anything that fits into a version string).

- - ### Method Detail

    - #### getBranch

          @Nullable
          String getBranch()

      The branch to select versions from. When not `null` selects only those versions that were built from the specified branch.
      Since:
        4.6

    - #### getPreferredVersion

          String getPreferredVersion()

      The preferred version of a module. The preferred version of a module can typically be upgraded during dependency resolution, unless further constraints are added.
      Returns:
        the preferred version, or empty string if no preferred version specified. Never null.

    - #### getRejectedVersions

          List<String> getRejectedVersions()

      Returns the list of versions that this module rejects (which may be exact versions, or ranges, anything that fits into a version string).
      Returns:
        the list of rejected versions