Interface VersionConstraint


@Experimental public interface VersionConstraint
Version constraint for dependency. Constraint is either a range ("[1,2)") or recommended version ("1.0").
Since:
4.0.0
  • Method Summary

    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

    • getVersionRange

      @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

      @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

      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

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