Interface VersionConstraint


@Experimental public interface VersionConstraint
Version constraint for dependency. Constraint is either a range ("[1,2)") or recommended version ("1.0"). VersionConstraint objects are created using the VersionParser service.
Since:
4.0.0
See Also:
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Returns a string representation of this version constraint
    boolean
    contains(Version version)
    Determines whether the specified version is contained within this constraint.
    Returns the recommended version of this constraint, or null if none.
    Returns the range of this constraint, or null if none.
  • Method Details Link icon

    • getVersionRange Link icon

      @Nullable VersionRange getVersionRange()
      Returns the range of this constraint, or null if none.

      Note: only one, this method or getRecommendedVersion() method must return non-null value.

    • getRecommendedVersion Link icon

      @Nullable Version getRecommendedVersion()
      Returns the recommended version of this constraint, or null if none.

      Note: only one, this method or getVersionRange() method must return non-null value.

    • contains Link icon

      boolean contains(@Nonnull Version version)
      Determines whether the specified version is contained within this constraint.
      Parameters:
      version - the version to test, must not be null
      Returns:
      true if this range contains the specified version, false otherwise
    • asString Link icon

      @Nonnull String asString()
      Returns a string representation of this version constraint
      Returns:
      the string representation of this version constraint