Class Version

java.lang.Object
edu.ucsb.nceas.metacat.Version
All Implemented Interfaces:
Comparable<Version>
Direct Known Subclasses:
DBVersion, MetacatVersion

public class Version extends Object implements Comparable<Version>
Author:
jones Version represents the current version information for this Metacat instance.
  • Field Details

    • allowedVersionLevels

      protected static int allowedVersionLevels
    • subversions

      protected int[] subversions
    • versionString

      protected String versionString
  • Constructor Details

    • Version

      public Version(String versionID)
      Create a Version object, setting sub version levels based on the given version id.
      Parameters:
      versionID -
  • Method Details

    • 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 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 String getVersionString()