Class Version

    • Constructor Detail

      • Version

        public Version()
        Constructor.
      • Version

        public Version​(int nMajor,
                       int nMinor,
                       int nPatch,
                       String strQualifier)
        Constructor.
        Parameters:
        nMajor - major digit
        nMinor - minor digit
        nPatch - patch digit
        strQualifier - qualifier
    • Method Detail

      • getMajor

        public int getMajor()
        Gets the major.
        Returns:
        the nMajor
      • setMajor

        public void setMajor​(int nMajor)
        Sets the major.
        Parameters:
        nMajor - the nMajor to set
      • getMinor

        public int getMinor()
        Gets the minor.
        Returns:
        the nMinor
      • setMinor

        public void setMinor​(int nMinor)
        Sets the minor.
        Parameters:
        nMinor - the nMinor to set
      • getPatch

        public int getPatch()
        Gets the patch.
        Returns:
        the nPatch
      • setPatch

        public void setPatch​(int nPatch)
        Sets the patch.
        Parameters:
        nPatch - the nPatch to set
      • getQualifier

        public String getQualifier()
        Gets the qualifier.
        Returns:
        the Qualifier
      • setQualifier

        public void setQualifier​(String strQualifier)
        Sets the qualifier.
        Parameters:
        strQualifier - the Qualifier to set
      • compareTo

        public int compareTo​(Object object)
        Compare to.
        Specified by:
        compareTo in interface Comparable
        Parameters:
        object - the object
        Returns:
        the int
      • getVersion

        public String getVersion()
        Gets the version.
        Returns:
        the version
      • snapshot

        public Version snapshot()
        returns the snapshot version.
        Returns:
        the snapshot version
      • nextMajor

        public Version nextMajor​(boolean bSnapshot)
        Build a new version object with major digit incremented.
        Parameters:
        bSnapshot - if snapshot qualifier needed
        Returns:
        The next version object
      • nextMinor

        public Version nextMinor​(boolean bSnapshot)
        Build a new version object with minor digit incremented.
        Parameters:
        bSnapshot - if snapshot qualifier needed
        Returns:
        The next version object
      • nextPatch

        public Version nextPatch​(boolean bSnapshot)
        Build a new version object with patch digit incremented.
        Parameters:
        bSnapshot - if snapshot qualifier needed
        Returns:
        The next version object
      • nextRelease

        public Version nextRelease()
        Build a new version object with no qualifier.
        Returns:
        The next version object
      • isSnapshot

        public boolean isSnapshot()
        Returns true if the version is qualified as Snapshot.
        Returns:
        true if the version is qualified as Snapshot
      • isCandidate

        public boolean isCandidate()
        Returns true if the version is qualified as Candidate.
        Returns:
        true if the version is qualified as Candidate
      • isSnapshot

        public static boolean isSnapshot​(String strVersion)
        Check if a given version is a SNAPSHOT.
        Parameters:
        strVersion - The version to check
        Returns:
        True if snapshot otherwise false
      • isCandidate

        public static boolean isCandidate​(String strVersion)
        Check if a given version is a RELEASE CANDIDATE.
        Parameters:
        strVersion - The version to check
        Returns:
        True if candidate otherwise false
      • getNextReleaseVersions

        public static List<String> getNextReleaseVersions​(String strPreviousReleaseVersion)
        Get a list of next versions for a given version.
        Parameters:
        strPreviousReleaseVersion - The current version
        Returns:
        The list
      • getNextSnapshotVersion

        public static String getNextSnapshotVersion​(String strVersion)
        Get the next snapshot version for a given version.
        Parameters:
        strVersion - The current version
        Returns:
        The version
      • getReleaseVersion

        public static String getReleaseVersion​(String strVersion)
        Get the next release version for a given version.
        Parameters:
        strVersion - The current version
        Returns:
        The version