Class PolarisCliVersionHandler


  • public class PolarisCliVersionHandler
    extends Object
    • Constructor Detail

      • PolarisCliVersionHandler

        public PolarisCliVersionHandler()
    • Method Detail

      • comparePolarisVersions

        public int comparePolarisVersions​(String version1,
                                          String version2)
        Compares two Polaris CLI version strings in the format "YYYY.MM.P" (e.g., "2024.9.0").
        Parameters:
        version1 - the first version string to compare, in the format "YYYY.MM.P"
        version2 - the second version string to compare, in the format "YYYY.MM.P"
        Returns:
        an integer that is: - Negative if version1 is less than version2 - Zero if version1 is equal to version2 - Positive if version1 is greater than version2 or major part of the version2 is less than length of 4 If either of the versions does not have exactly three components (major, minor, patch), the method returns 1, implying an invalid version format.