public class VersionInfo extends Object implements Serializable, Comparable<VersionInfo>
Constructor and Description |
---|
VersionInfo(int major,
int minor) |
VersionInfo(int major,
int minor,
int release,
int build) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(VersionInfo o) |
boolean |
equals(Object obj) |
int |
getBuildNumber() |
int |
getMajorVersion() |
int |
getMinorVersion() |
int |
getRelease() |
int |
hashCode() |
static VersionInfo |
parse(String version)
Parses a version string - assumed to contain at most 4 non-negative
components separated by a '.'.
|
String |
toString() |
public VersionInfo(int major, int minor)
public VersionInfo(int major, int minor, int release, int build)
public final int getMajorVersion()
public final int getMinorVersion()
public final int getRelease()
public final int getBuildNumber()
public int compareTo(VersionInfo o)
compareTo
in interface Comparable<VersionInfo>
public static VersionInfo parse(String version) throws NumberFormatException
version
- The version string - ignored if null
/emptyVersionInfo
- or null
if empty inputNumberFormatException
- If failed to parse any of the componentsIllegalArgumentException
- If any of the parsed components is negativeCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.