public class Version extends Object implements Comparable<Version>
| Constructor and Description |
|---|
Version(int... numbers)
Creates a new version with the given numbers.
|
Version(String appendix,
int... numbers)
Creates a new version with the given numbers.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Version version) |
boolean |
equals(Object obj) |
String |
getAppendix()
Returns the optional appendix.
|
int |
getMajor()
Returns the first number of the version.
|
int |
getMinor()
Returns the second number of the version.
|
int |
getNumber(int index)
Returns the number at the given index.
|
int |
getPatch()
Returns the fourth number of the version.
|
int |
getRelease()
Returns the third number of the version.
|
int |
hashCode() |
static Version |
parse(String versionString)
Parses a version from the given string.
|
String |
toString() |
public Version(int... numbers)
numbers - The numbers of the versionpublic Version(String appendix, int... numbers)
appendix - The optional appendixnumbers - The numbers of the versionpublic int getNumber(int index)
index - The index of the number0 if there is no number at the given
indexpublic int getMajor()
public int getMinor()
public int getRelease()
public int getPatch()
public String getAppendix()
null if there is no appendixpublic String toString()
toString in class ObjectObject.toString()public static Version parse(String versionString)
versionString - The version string to parsenull if the string could not
be parsedpublic int compareTo(Version version)
compareTo in interface Comparable<Version>Comparable.compareTo(java.lang.Object)public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()Copyright © 2026. All rights reserved.