Class VersionRange
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.VersionRange
-
public class VersionRange extends java.lang.ObjectImplements a version range- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static VersionRangeINFINITEInfinite (covers all) range.
-
Constructor Summary
Constructors Constructor Description VersionRange(Version v)Creates a new version range that exactly includes the given version.VersionRange(Version low, boolean lowIncl, Version high, boolean highIncl)Creates a new version range.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static VersionRangefromString(java.lang.String str)Creates a range from a stringVersiongetHigh()Returns the upper boundVersiongetLow()Returns the lower boundinthashCode()booleanisHighInclusive()Returnstrueif the upper bound is inclusivebooleanisInRange(Version v)Checks if the given version is in this range.booleanisLowInclusive()Returnstrueif the lower bound is inclusivejava.lang.StringtoString()
-
-
-
Field Detail
-
INFINITE
public static final VersionRange INFINITE
Infinite (covers all) range.
-
-
Constructor Detail
-
VersionRange
public VersionRange(Version low, boolean lowIncl, Version high, boolean highIncl)
Creates a new version range.- Parameters:
low- lower bound ornulllowIncl- specifies if lower bound is inclusivehigh- upper bound ornullhighIncl- specifies if upper bound is inclusive- Throws:
java.lang.IllegalArgumentException- if bounds are not valid
-
VersionRange
public VersionRange(Version v)
Creates a new version range that exactly includes the given version.- Parameters:
v- the version.
-
-
Method Detail
-
getLow
public Version getLow()
Returns the lower bound- Returns:
- the lower bound or
null
-
isLowInclusive
public boolean isLowInclusive()
Returnstrueif the lower bound is inclusive- Returns:
trueif the lower bound is inclusive
-
getHigh
public Version getHigh()
Returns the upper bound- Returns:
- the upper bound or
null
-
isHighInclusive
public boolean isHighInclusive()
Returnstrueif the upper bound is inclusive- Returns:
trueif the upper bound is inclusive
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isInRange
public boolean isInRange(Version v)
Checks if the given version is in this range.- Parameters:
v- the version to check- Returns:
trueif the given version is in this range.
-
fromString
public static VersionRange fromString(java.lang.String str)
Creates a range from a string- Parameters:
str- string- Returns:
- the version range
-
-