Class VersionRange

java.lang.Object
net.adoptopenjdk.icedteaweb.jnlp.version.VersionRange

public class VersionRange extends Object
A version-range is either a version-id, a version-id followed by a star (*), a version-id followed by a plus sign (+) , or two version-ranges combined using an ampersand (&). The star means prefix match, the plus sign means this version or greater, and the ampersand means the logical and-ing of the two version-ranges.

The syntax of version-strings is:

      version-string     ::=  version-range ( " " element) *
      version-range      ::=  simple-range ( "&" simple-range) *
      simple-range       ::=  version-id | version-id modifier
      modifier           ::=  "+" | "*"
 

See JSR-56 Specification, Appendix A.

See Also:
  • Method Details

    • fromString

      public static VersionRange fromString(String versionRange)
      Construct a version-range by the given versionRange.
      Parameters:
      versionRange - a version-range
      Returns:
      a version-id
    • contains

      public boolean contains(String versionId)
      Check if this version-range contains the given versionId.
      Parameters:
      versionId - a version-id
      Returns:
      true if this version-range contains versionId, false otherwise.
    • contains

      public boolean contains(VersionId versionId)
      Check if this version-range contains the given versionId.
      Parameters:
      versionId - a version-id
      Returns:
      true if this version-range contains versionId, false otherwise.
    • equals

      public boolean equals(Object otherVersionRange)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Provides a string representation of this VersionRange.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this version-range