public class Version extends Object implements Comparable<Version>
Constructor and Description |
---|
Version(int major) |
Version(int major,
int minor) |
Version(int major,
int minor,
int micro) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version o) |
boolean |
equals(Object o) |
int |
getMajor() |
int |
getMinor() |
int |
hashCode() |
boolean |
isGreaterOrEqualTo(Version version) |
boolean |
isGreaterThan(Version version) |
boolean |
isLessThan(Version version) |
static Version |
lenient(String version)
Supported formats:
- 1.2.3
- 1.2
- 1
all optionally followed by non digit or dot trailing characters.
|
static Version |
of(String version)
Supported formats:
- 1.2.3
- 1.2
- 1
|
void |
setProductName(String productName) |
void |
setVersionString(String versionString) |
String |
toString() |
public Version(int major, int minor, int micro)
public Version(int major, int minor)
public Version(int major)
public int compareTo(@NotNull Version o)
compareTo
in interface Comparable<Version>
public boolean isGreaterThan(@NotNull Version version)
public boolean isGreaterOrEqualTo(@NotNull Version version)
public boolean isLessThan(@NotNull Version version)
public static Version of(@NotNull String version) throws IllegalArgumentException
version
- to be parsedIllegalArgumentException
- if can't parsepublic static Version lenient(@NotNull String version) throws IllegalArgumentException
version
- to be parsedIllegalArgumentException
- if can't parsepublic int getMajor()
public int getMinor()
public void setVersionString(String versionString)
public void setProductName(String productName)
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.