Package com.avoka.core.util.ver
Class Version
java.lang.Object
com.avoka.core.util.ver.Version
- All Implemented Interfaces:
Comparable<Version>
Version utility that supports versions in format "a.b.c-qualifier".
- Since:
- 17.10.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares this version with another version object.boolean
Indicates whether some other object is "equal to" this one.getMajor()
Get the major version numbergetMinor()
Get the minor version number.getPatch()
Get the patch version number.Get qualifier.int
hashCode()
Returns a hash code value for the object.Increment the minor version number and return a new Version object.Increment the patch version number and return a new Version object.toString()
Gets to string of this object
-
Field Details
-
NEW_CORE_SERVICE_VERSION
New core service version default. -
NEW_TEMPL_SERVICE_VERSION
New template service version default.
-
-
Constructor Details
-
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
Constructs version object by major number. Used for backward compatibility.- Parameters:
major
- major version number (should be positive)
-
-
Method Details
-
getMajor
Get the major version number- Returns:
- the major version number
-
getMinor
Get the minor version number.- Returns:
- the minor version number
-
getPatch
Get the patch version number.- Returns:
- the patch version number
-
getQualifier
Get qualifier.- Returns:
- the qualifier
-
incrMinor
Increment the minor version number and return a new Version object.- Returns:
- the minor version number and return a new Version object
-
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 byHashMap
. -
equals
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' -
compareTo
Compares this version with another version object.- Specified by:
compareTo
in interfaceComparable<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
Gets to string of this object
-