Class VersionRange


  • public final class VersionRange
    extends java.lang.Object
    • Constructor Detail

      • VersionRange

        public VersionRange​(java.lang.String version)
        Parameters:
        version - version for the verioninfo
      • VersionRange

        public VersionRange​(java.lang.String version,
                            boolean exactVersion)
        This method should be used to create a version range from a single version string.
        Parameters:
        version - version for the versioninfo
        exactVersion - whether this is an exact version true or goes to infinity false
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • getExactVersion

        public Version getExactVersion()
        this method returns the exact version from the versionInfo obj. this is used for DeploymentContent only to return a valid exact version otherwise, null is returned.
        Returns:
        the exact version
      • getMaximumVersion

        public Version getMaximumVersion()
        get the maximum version
        Returns:
        the maximum version
      • getMinimumVersion

        public Version getMinimumVersion()
        get the minimum version
        Returns:
        the minimum version
      • isMaximumExclusive

        public boolean isMaximumExclusive()
        is the maximum version exclusive
        Returns:
        is the max version in the range.
      • isMaximumUnbounded

        public boolean isMaximumUnbounded()
        is the maximum version unbounded
        Returns:
        true if no upper bound was specified.
      • isMinimumExclusive

        public boolean isMinimumExclusive()
        is the minimum version exclusive
        Returns:
        true if the min version is in range.
      • matches

        public boolean matches​(Version version)
        This method checks that the provided version matches the desired version.
        Parameters:
        version - the version.
        Returns:
        true if the version matches, false otherwise.
      • isExactVersion

        public boolean isExactVersion()
        check if the versioninfo is the exact version
        Returns:
        true if the range will match 1 exact version.
      • intersect

        public VersionRange intersect​(VersionRange r)
        Create a new version range that is the intersection of this and the argument. In other words, the largest version range that lies within both this and the parameter.
        Parameters:
        r - a version range to be intersected with this.
        Returns:
        a new version range, or null if no intersection is possible.
      • parseVersionRange

        public static VersionRange parseVersionRange​(java.lang.String s)
                                              throws java.lang.IllegalArgumentException
        Parse a version range..
        Parameters:
        s -
        Returns:
        VersionRange object.
        Throws:
        java.lang.IllegalArgumentException - if the String could not be parsed as a VersionRange
      • parseVersionRange

        public static VersionRange parseVersionRange​(java.lang.String s,
                                                     boolean exactVersion)
                                              throws java.lang.IllegalArgumentException
        Parse a version range and indicate if the version is an exact version
        Parameters:
        s -
        exactVersion -
        Returns:
        VersionRange object.
        Throws:
        java.lang.IllegalArgumentException - if the String could not be parsed as a VersionRange