public class DelimitedVersion extends java.lang.Object implements java.lang.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(java.lang.Object obj) |
int |
hashCode() |
static DelimitedVersion |
parse(java.lang.String versionString)
Parses a delimited version number from the provided string.
|
java.lang.String |
toString() |
public DelimitedVersion(long[] numericParts)
Creates a version with the specified parts, ordered from major to minor.
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(@NonNull
DelimitedVersion other)
compareTo in interface java.lang.Comparable<DelimitedVersion>public static DelimitedVersion parse(java.lang.String versionString)
Parses a delimited version number from the provided string.