public class DelimitedVersion extends Object implements Comparable<DelimitedVersion>
Represents a delimited version number for an application. This can parse common version number formats, treating any sequence of non-numeric characters as a delimiter, and discards these to retain just the numeric content for comparison. Trailing zeroes in a version number are discarded to produce a compact, canonical representation. Empty versions are equivalent to “0”. Each numeric part is expected to fit within a 64-bit integer.
| Constructor and Description |
|---|
DelimitedVersion(long[] numericParts)
Creates a version with the specified parts, ordered from major to minor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DelimitedVersion other) |
boolean |
equals(Object obj) |
int |
hashCode() |
static DelimitedVersion |
parse(String versionString)
Parses a delimited version number from the provided string.
|
String |
toString() |
public DelimitedVersion(long[] numericParts)
Creates a version with the specified parts, ordered from major to minor.
public int compareTo(@NonNull
DelimitedVersion other)
compareTo in interface Comparable<DelimitedVersion>public static DelimitedVersion parse(String versionString)
Parses a delimited version number from the provided string.