Package ca.uhn.hl7v2

Enum Class Version

java.lang.Object
java.lang.Enum<Version>
ca.uhn.hl7v2.Version
All Implemented Interfaces:
Serializable, Comparable<Version>, Constable

public enum Version extends Enum<Version>
  • Enum Constant Details

  • Method Details

    • values

      public static Version[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Version valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getVersion

      public String getVersion()
      Returns a version string (e.g. "2.1", or "2.5.1")
    • getPackageVersion

    • supportsVersion

      public static boolean supportsVersion(String theVersion)
      Returns true if theVersion is a valid HL7 version string representing a known version, e.g. "2.4", "2.6"
    • versionOf

      public static Version versionOf(String version)
      Parameters:
      version - The version string, e.g. "2.1" or "2.6"
    • allVersions

      public static boolean allVersions(Set<Version> someVersions)
      Parameters:
      someVersions - set of versions to be tested
      Returns:
      true if someVersions contain all supported HL7 versions
    • isGreaterThan

      public boolean isGreaterThan(Version theVersion)
      Returns true if this version is greater than the specified version
    • latestVersion

      public static Version latestVersion()
      Returns the newest available version of the message structure classes on the classpath, or null if none are found
    • asOf

      public static Version[] asOf(Version v)
    • except

      public static Version[] except(Version... v)
    • before

      public static Version[] before(Version v)
    • modelPackageName

    • available

      public boolean available()
      Returns true if the structure classes for this particular version are available on the classpath.
    • availableVersions

      public static List<Version> availableVersions()
      Returns a list of all versions for which the structure JARs have been found on the classpath.
    • lowestAvailableVersion

      Returns the lowest version for which the structure classes are found on the classes. For instance, if hapi-structures-v24-[version].jar is the only structure JAR on the current JVM classpath, V24 will be returned.

      Returns null if none are found

    • highestAvailableVersionOrDefault

      Returns the highest version for which the structure classes are found on the classes. For instance, if hapi-structures-v24-[version].jar is the only structure JAR on the current JVM classpath, V24 will be returned.

      </> If no structure JARs at all are found, returns a default value of V25

    • newGenericMessage

      Construct and return a new GenericMessage for the given version