Interface VersionConstraint

  • All Superinterfaces:
    Serializable

    public interface VersionConstraint
    extends Serializable
    An extension version constraint. Generally on a dependency. A constraint can either consist of one or more version ranges or a single version. In the first case, the constraint expresses a hard requirement on a version matching one of its ranges. In the second case, the constraint expresses a soft requirement on a specific version (i.e. a recommendation).
    Since:
    4.0M1
    Version:
    $Id: c1ee6ec985d6a8d8cfb4b6ba26830e3ae25555b5 $
    • Method Detail

      • getVersion

        Version getVersion()
        Gets the version recommended by this constraint.
        Returns:
        the recommended version or null if none.
      • getValue

        String getValue()
        Returns:
        a String representation of the version constraint
      • containsVersion

        boolean containsVersion​(Version version)
        Indicate if the provided Version satisfies the constraint.
        Parameters:
        version - the version to test, null is invalid
        Returns:
        true if the provided version satisfies this constraint, false otherwise
      • isCompatible

        boolean isCompatible​(Version version)
        Indicate if the provided Version is compatible with this version.

        The difference with containsVersion(Version) is that this method is trying to determine if this version should work with this constraint while containsVersion(Version) indicate if that's the ideal version for this constraint. This apply with constraint not defining an exact version range but only a recommended version constraint, in that case the constraint indicate what is the version that would ideally be required but it should work with more recent version.

        Parameters:
        version - the version to test, null is invalid
        Returns:
        true if the provided version is compatible with this constraint
        Since:
        4.1M2