edu.ucsb.nceas.metacat

## Class Version

- java.lang.Object
- - edu.ucsb.nceas.metacat.Version

- All Implemented Interfaces:
    java.lang.Comparable<Version>
  Direct Known Subclasses:
    DBVersion, MetacatVersion

      public class Version
      extends java.lang.Object
      implements java.lang.Comparable<Version>

  Author:
    jones Version represents the current version information for this Metacat instance.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `allowedVersionLevels`
    `protected int[]` | `subversions`
    `protected java.lang.String` | `versionString`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Version(java.lang.String versionID)` Create a Version object, setting sub version levels based on the given version id.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Version anotherVersion)` Compare this Version object to another.
    `int` | `getSubversion(int level)`
    `java.lang.String` | `getVersionString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### allowedVersionLevels

          protected static int allowedVersionLevels

    - #### subversions

          protected int[] subversions

    - #### versionString

          protected java.lang.String versionString

  - ### Constructor Detail

    - #### Version

          public Version(java.lang.String versionID)

      Create a Version object, setting sub version levels based on the given version id.
      Parameters:
        `versionID` -

  - ### Method Detail

    - #### compareTo

          public int compareTo(Version anotherVersion)

      Compare this Version object to another. Use the sub version levels to do the comparison. In that way, we can make sure that something like version 1.0.0.1 is less than 2.0.1.
      Specified by:
        `compareTo` in interface `java.lang.Comparable<Version>`
      Parameters:
        `anotherVersion` -
      Returns:
        -1 if this version is less than given version, 0 if they are equal and 1 if this version is greater than given version.

    - #### getSubversion

          public int getSubversion(int level)

    - #### getVersionString

          public java.lang.String getVersionString()

Copyright © 2020 Regents of the University of California. All Rights Reserved.