Class Version
- java.lang.Object
 - 
- org.apache.jackrabbit.vault.packaging.Version
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(Version o)Compares this version to the given one, segment by segment without any special "SNAPSHOT" handling.static Versioncreate(java.lang.String str)Creates a new version from the given string.static Versioncreate(java.lang.String[] segments)Creates a new version from version segmentsbooleanequals(java.lang.Object o)java.lang.String[]getNormalizedSegments()Returns all segments.inthashCode()intosgiCompareTo(Version o)Deprecated.since 3.1.32.java.lang.StringtoString() 
 - 
 
- 
- 
Field Detail
- 
EMPTY
public static final Version EMPTY
The empty version 
 - 
 
- 
Method Detail
- 
create
@Nonnull public static Version create(@Nullable java.lang.String str)
Creates a new version from the given string.- Parameters:
 str- the version string.- Returns:
 - the new version or 
EMPTYifstris an empty string. - Since:
 - 2.2.4
 
 
- 
create
@Nonnull public static Version create(@Nullable java.lang.String[] segments)
Creates a new version from version segments- Parameters:
 segments- version segments- Returns:
 - the new version or 
EMPTYifsegmentsis empty. - Since:
 - 2.2.4
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object o)
- Overrides:
 equalsin classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
getNormalizedSegments
public java.lang.String[] getNormalizedSegments()
Returns all segments.- Returns:
 - all segments.
 
 
- 
compareTo
public int compareTo(Version o)
Compares this version to the given one, segment by segment without any special "SNAPSHOT" handling.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"
- Specified by:
 compareToin interfacejava.lang.Comparable<Version>- Parameters:
 o- the other version- Returns:
 - a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version.
 
 
- 
osgiCompareTo
@Deprecated public int osgiCompareTo(Version o)
Deprecated.since 3.1.32. usecompareTo(Version). See JCRVLT-146Same as withcompareTo(Version).- Parameters:
 o- the other version- Returns:
 - a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version.
 
 
 - 
 
 -