Class Version
- java.lang.Object
-
- io.streamthoughts.azkarra.api.util.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version that)
boolean
equals(Object o)
static Version
getLatest(Version... versions)
Static helper for returning the latest version from a list ofVersion
.int
hashCode()
int
incrementalVersion()
static boolean
isEqual(Version v1, String v2)
static boolean
isEqual(String v1, String v2)
int
majorVersion()
int
minorVersion()
static Version
parse(String version)
Static helper for creating a new version based on the specified string.io.streamthoughts.azkarra.api.util.Version.Qualifier
qualifier()
String
toString()
-
-
-
Constructor Detail
-
Version
public Version(int majorVersion, int minorVersion, int incrementalVersion, String qualifier)
Creates a newVersion
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
-
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 ofVersion
.- 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()
-
compareTo
public int compareTo(Version that)
- Specified by:
compareTo
in interfaceComparable<Version>
-
-