public final class Version extends Object implements Comparable<Version>
parse(String)| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Version other) |
boolean |
equals(Object other) |
Optional<String> |
getLabel()
Gets a pre-release label.
|
int |
getMajor()
Gets a major value.
|
int |
getMinor()
Gets a minor value.
|
OptionalInt |
getPatch()
Gets a patch value.
|
int |
hashCode() |
static Version |
parse(String version)
Obtain a
Version from a text string such as 4.0. |
String |
toString() |
public static Version parse(String version) throws IllegalArgumentException
Version from a text string such as 4.0.version - the version to parseVersionIllegalArgumentException - version is invalidpublic int getMajor()
public int getMinor()
public OptionalInt getPatch()
public int compareTo(Version other)
compareTo in interface Comparable<Version>Copyright © 2023. All rights reserved.