Class Version

java.lang.Object
com.avoka.core.util.ver.Version
All Implemented Interfaces:
Comparable<Version>

public class Version extends Object implements Comparable<Version>
Version utility that supports versions in format "a.b.c-qualifier".
Since:
17.10.0
  • Field Details

    • NEW_CORE_SERVICE_VERSION

      public static final Version NEW_CORE_SERVICE_VERSION
      New core service version default.
    • NEW_TEMPL_SERVICE_VERSION

      public static final Version NEW_TEMPL_SERVICE_VERSION
      New template service version default.
  • Constructor Details

    • Version

      public Version(String version)
      Constructs version object by version string. Expected format is "a.b.c-qualifier" no larger than 20 chars.
      Parameters:
      version - string object in format "a.b.c-qualifier" no larger than 20 chars
    • Version

      public Version(Integer major)
      Constructs version object by major number. Used for backward compatibility.
      Parameters:
      major - major version number (should be positive)
  • Method Details

    • getMajor

      public Integer getMajor()
      Get the major version number
      Returns:
      the major version number
    • getMinor

      public Integer getMinor()
      Get the minor version number.
      Returns:
      the minor version number
    • getPatch

      public Integer getPatch()
      Get the patch version number.
      Returns:
      the patch version number
    • getQualifier

      public String getQualifier()
      Get qualifier.
      Returns:
      the qualifier
    • incrMinor

      public Version incrMinor()
      Increment the minor version number and return a new Version object.
      Returns:
      the minor version number and return a new Version object
    • incrPatch

      public Version incrPatch()
      Increment the patch version number and return a new Version object.
      Returns:
      version with incremented patch version number as a new object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. Implementation relies that the object is of same type and compares its fields. EqualsBuilder in order to return 'true'
      Overrides:
      equals in class Object
      Parameters:
      obj - an object.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • compareTo

      public int compareTo(Version otherVersion)
      Compares this version with another version object.
      Specified by:
      compareTo in interface Comparable<Version>
      Parameters:
      otherVersion - the version object to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
    • toString

      public String toString()
      Gets to string of this object
      Overrides:
      toString in class Object
      Returns:
      to string of this object