Package tigase.util

Class Version

    • Method Detail

      • of

        public static Version of​(String str)
                          throws IllegalArgumentException
        Supports both tigase-server-7.2.0-SNAPSHOT-b4895-dist-max.tar.gz and version strings
        Parameters:
        str - string to be parsed. Must match the supported formats
        Returns:
        a Version object based on the provided string.
        Throws:
        IllegalArgumentException - when provided input doesn't match supported formats
      • getBaseVersion

        public Version getBaseVersion()
      • getBugfix

        public int getBugfix()
      • getBuild

        public int getBuild()
      • getCommit

        public String getCommit()
      • getMajor

        public int getMajor()
      • getMinor

        public int getMinor()
      • getTypeNumber

        public int getTypeNumber()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • increment

        public Version increment​(Version.FIELD field,
                                 int amount)
                          throws IllegalArgumentException
        Method increments given field by the specified amount
        Parameters:
        field - to be incremented - only incrementable fields are supported, i.e. any of the incrementableFields.
        amount - by which version should be incremented
        Returns:
        incremented version if correct field was passed as argument, otherwise same non-incremented version is returned.
        Throws:
        IllegalArgumentException
      • isZero

        public boolean isZero()
      • toString

        public String toString​(int padding)