Class VersionRange

java.lang.Object
org.apache.juneau.internal.VersionRange

public class VersionRange extends Object
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.
See Also:
  • Constructor Details

    • VersionRange

      public VersionRange(String range)
      Constructor.
      Parameters:
      range - The range string to parse.
  • Method Details

    • matches

      public boolean matches(String v)
      Returns true if the specified version string matches this version range.
      Parameters:
      v - The version string (e.g. "1.2.3")
      Returns:
      true if the specified version string matches this version range.
    • toString

      public String toString()
      Overrides:
      toString in class Object