Package io.atomix.utils
Class Version
- java.lang.Object
-
- io.atomix.utils.Version
-
- All Implemented Interfaces:
Comparable<Version>
public final class Version extends Object implements Comparable<Version>
Atomix software version.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Returns the build version number.intcompareTo(Version that)booleanequals(Object object)static Versionfrom(int major, int minor, int patch, String build)Returns a new version from the given parts.static Versionfrom(String version)Returns a new version from the given version string.inthashCode()intmajor()Returns the major version number.intminor()Returns the minor version number.intpatch()Returns the patch version number.StringtoString()
-
-
-
Method Detail
-
from
public static Version from(String version)
Returns a new version from the given version string.- Parameters:
version- the version string- Returns:
- the version object
- Throws:
IllegalArgumentException- if the version string is invalid
-
from
public static Version from(int major, int minor, int patch, String build)
Returns a new version from the given parts.- Parameters:
major- the major version numberminor- the minor version numberpatch- the patch version numberbuild- the build version number- Returns:
- the version object
-
major
public int major()
Returns the major version number.- Returns:
- the major version number
-
minor
public int minor()
Returns the minor version number.- Returns:
- the minor version number
-
patch
public int patch()
Returns the patch version number.- Returns:
- the patch version number
-
build
public String build()
Returns the build version number.- Returns:
- the build version number
-
compareTo
public int compareTo(Version that)
- Specified by:
compareToin interfaceComparable<Version>
-
-