Package org.apache.juneau.commons.lang
Class VersionRange
java.lang.Object
org.apache.juneau.commons.lang.VersionRange
Represents an OSGi-style version range like "1.2" or "[1.0,2.0)" .
The range can be any of the following formats:
"[0,1.0)" = Less than 1.0. 1.0 and 1.0.0 does not match."[0,1.0]" = Less than or equal to 1.0. Note that 1.0.1 will match."1.0" = At least 1.0. 1.0 and 2.0 will match.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
VersionRange
Constructor.- Parameters:
range- The range string to parse. Must not benull .
-
-
Method Details
-
of
Static creator.- Parameters:
range- The range string to parse (e.g."1.2" or"[1.0,2.0)" ). Must not benull .- Returns:
- A new
VersionRangeobject.
-
matches
Returnstrue if the specified version string matches this version range.- Parameters:
v- The version string (e.g."1.2.3" ). Can benull or empty.- Returns:
true if the specified version string matches this version range.
-
toString
-