Class MavenVersionRange


  • public class MavenVersionRange
    extends MavenVersionSpecification
    Provides a representation of a maven version range. The implementation is a small wrapper around VersionRange.

    Because VersionRange has only a private constructor and cannot be extended, the wrapper delegates to an instance of VersionRange.

    • Constructor Detail

      • MavenVersionRange

        public MavenVersionRange​(org.apache.maven.artifact.versioning.VersionRange range)
        Instantiates a new maven version range from the given range.
        Parameters:
        range - the range
      • MavenVersionRange

        public MavenVersionRange​(String range)
        Instantiates a new maven version range from the given representation. If version is null it is considered to be the "all inclusive range" ("[0,)").
        Parameters:
        range - the range
    • Method Detail

      • versionRange

        public org.apache.maven.artifact.versioning.VersionRange versionRange()
        Returns the version range that this instance delegates to.
        Returns:
        the org.apache.maven.artifact.versioning. version range
      • includes

        public boolean includes​(MavenVersionSpecification mavenVersion)
        Checks if this version range includes the specified version or range. A range is included if it is fully included.
        Parameters:
        mavenVersion - the maven version
        Returns:
        the result
      • restrict

        public MavenVersionRange restrict​(MavenVersionRange restriction)
        Creates and returns a new VersionRange that is a restriction of this version range and the specified version range.
        Parameters:
        restriction - the restriction
        Returns:
        the maven version range
        See Also:
        VersionRange.restrict(org.apache.maven.artifact.versioning.VersionRange)
      • parseRange

        public static MavenVersionRange parseRange​(String version)
        Creates a new maven version range from the given representation.
        Parameters:
        version - the string representation
        Returns:
        the maven version range
      • isRange

        @Deprecated
        public static boolean isRange​(String version)
        Checks if is the provided version representation is a range. If version is null it is considered to be the "all inclusive range" ("[0,)").
        Parameters:
        version - the version
        Returns:
        true, if is range