Class Version

java.lang.Object
org.cqframework.cql.cql2elm.model.Version
All Implemented Interfaces:
Comparable<Version>

public class Version extends Object implements Comparable<Version>
Implements a comparable version for use in comparing CQL artifact versions. Supports versions specified in filename strings according to the following pattern: [v]{{major}}(.|-){{minor}}(.|-){{patch}}(.|-){{build}} where major, minor, and patch are all required to be unsigned integers, and build is any string Examples: 1.0.0 -> major: 1, minor: 0, patch: 0 v1-0-0 -> major: 1, minor: 0, patch: 0 v1-0-0-SNAPSHOT -> major: 1, minor: 0, patch: 0, build: snapshot NOTE: Deliberately not using Apache ComparableVersion to a) avoid dependencies on Maven and b) allow for more flexible version strings used by MAT file naming conventions.
  • Constructor Details

    • Version

      public Version(String version)
  • Method Details

    • getMajorVersion

      public Integer getMajorVersion()
    • getMinorVersion

      public Integer getMinorVersion()
    • getPatchVersion

      public Integer getPatchVersion()
    • getBuildVersion

      public String getBuildVersion()
    • compareTo

      public int compareTo(Version that)
      Specified by:
      compareTo in interface Comparable<Version>
    • compatibleWith

      public boolean compatibleWith(Version that)
    • matchStrictly

      public boolean matchStrictly(Version that)
    • isComparable

      public boolean isComparable(int level)
    • isComparable

      public boolean isComparable()
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object