public final class Version extends Object implements Comparable<Version>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version that) |
static Version |
create(Integer... components)
Creates a new version from components.
|
boolean |
equals(Object o) |
Integer |
getMajor()
Returns this version number's major component.
|
Integer |
getMicro()
Returns this version number's minor component.
|
Integer |
getMinor()
Returns this version number's minor component.
|
Integer |
getRevision()
Returns this version number's minor component.
|
String |
getVersion()
Returns this version as a string.
|
int |
hashCode() |
static Version |
parse(String version)
Parses the passed version string.
|
String |
toString() |
public static Version parse(String version)
version
- the version string.public static Version create(Integer... components)
components
- the componentspublic Integer getMajor()
public Integer getMinor()
null
if this version number
doesn't have a minor component.public Integer getMicro()
null
if this version number
doesn't have a minor component.public Integer getRevision()
null
if this version number
doesn't have a revision component.public String getVersion()
public int compareTo(Version that)
compareTo
in interface Comparable<Version>
Copyright © 2019. All rights reserved.