Class Version

  • All Implemented Interfaces:
    Comparable<Version>

    public class Version
    extends Object
    implements Comparable<Version>
    A version class which supports the following pattern : ..- Supported qualifier are : alpha, beta, snapshot, rc, release.
    • Constructor Detail

      • Version

        public Version​(int majorVersion,
                       int minorVersion,
                       int incrementalVersion,
                       String qualifier)
        Creates a new Version instance.
        Parameters:
        majorVersion - the major version (must be superior or equal to 0).
        minorVersion - the minor version (must be superior or equal to 0).
        incrementalVersion - the incremental version (must be superior or equal to 0).
        qualifier - the qualifier.
    • Method Detail

      • isEqual

        public static boolean isEqual​(String v1,
                                      String v2)
      • isEqual

        public static boolean isEqual​(Version v1,
                                      String v2)
      • parse

        public static Version parse​(String version)
        Static helper for creating a new version based on the specified string.
        Parameters:
        version - the version.
        Returns:
        a new Version instance.
      • getLatest

        public static Version getLatest​(Version... versions)
        Static helper for returning the latest version from a list of Version.
        Parameters:
        versions - the list of version.
        Returns:
        the latest version.
      • majorVersion

        public int majorVersion()
      • minorVersion

        public int minorVersion()
      • incrementalVersion

        public int incrementalVersion()
      • qualifier

        public io.streamthoughts.azkarra.api.util.Version.Qualifier qualifier()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object