Class VersionRange


  • public class VersionRange
    extends Object
    Defines Version range
    Examples: [8.3.5;8.3.6), (8.3.5;8.3.6), [8.3.5;8.3.6], (8.3.5;8.3.6]
    • Field Detail

      • EMPTY_RANGE

        public static final VersionRange EMPTY_RANGE
        An empty version range. The empty version range includes all valid versions (any version greater than or equal to the version 0.0.0).
      • minVersion

        public final Version minVersion
      • minInclusive

        public final boolean minInclusive
      • maxVersion

        public final Version maxVersion
      • maxInclusive

        public final boolean maxInclusive
    • Constructor Detail

      • VersionRange

        public VersionRange​(Version minVersion,
                            boolean minInclusive,
                            Version maxVersion,
                            boolean maxInclusive)
        Constructor
        Parameters:
        minVersion - min version of range, can't be null
        minInclusive - inclusive or not for minVersion
        maxVersion - max version of range, if null then maxVersion = new Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)
        maxInclusive - inclusive or not for maxVersion
        Throws:
        IllegalArgumentException - if validation error was detected
    • Method Detail

      • isIntersect

        public boolean isIntersect​(VersionRange range)
        Checks version range for intersect
        Parameters:
        range - checking range, can't be null
        Returns:
        true if intersect
      • isInRange

        public boolean isInRange​(Version version)
        Checks that current range contains version
        Parameters:
        version - checking version, can't be null
        Returns:
        true if intersect