Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version o)
Compares this version to the given one, segment by segment without any special
"SNAPSHOT" handling.
|
static Version |
create(java.lang.String str)
Creates a new version from the given string.
|
static Version |
create(java.lang.String[] segments)
Creates a new version from version segments
|
boolean |
equals(java.lang.Object o) |
java.lang.String[] |
getNormalizedSegments()
Returns all segments.
|
int |
hashCode() |
int |
osgiCompareTo(Version o)
Deprecated.
since 3.1.32. use
compareTo(Version) . See JCRVLT-146 |
java.lang.String |
toString() |
public static final Version EMPTY
@Nonnull public static Version create(@Nullable java.lang.String str)
str
- the version string.EMPTY
if str
is an empty string.@Nonnull public static Version create(@Nullable java.lang.String[] segments)
segments
- version segmentsEMPTY
if segments
is empty.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String[] getNormalizedSegments()
public int compareTo(Version o)
Examples: "1" < "2" "1.0" < "2" "2.0.1" < "2.1" "2.1" < "2.1.1" "2.9" < "2.11" "2.1" < "2.1-SNAPSHOT" "2.1" < "2.1-R1234556" "2.1-R12345" < "2.1-SNAPSHOT"
compareTo
in interface java.lang.Comparable<Version>
o
- the other version@Deprecated public int osgiCompareTo(Version o)
compareTo(Version)
. See JCRVLT-146compareTo(Version)
.o
- the other versionCopyright © 2010 - 2020 Adobe. All Rights Reserved