Version
@Serializable { simple=true }
const class Version : Obj
Version is defined as a list of decimal digits separated by the dot. Convention for Fantom pods is a four part version format of major.minor.build.patch.
Parse a string representation into a Version
Construct with list of integer segments
Default value is "0"
Get the fourth segment which represents the patch number
The string format is equivalent to segments.join(".")
Compare from from most significant segment to least significant segment
Get the first, most significant segment which represents the major version
Get the second segment which represents the minor version
Get the third segment which represents the build number
Return true if equal segments
Return toStr.hash
Get a readonly list of the integer segments
Int? build()
Get the third segment which represents the build number. Return null if version has less than three segments.
virtual Int compare(Obj obj)
Compare from from most significant segment to least significant segment.
Examples:
1.6 > 1.4 2.0 > 1.9 1.2.3 > 1.2 1.11 > 1.9.3
const static Version : defVal
Default value is "0".
virtual Bool equals(Obj? obj)
Return true if equal segments.
static new fromStr(Str version, Bool checked)
Parse a string representation into a Version. If invalid format and checked is false return null, otherwise throw ParseErr.
virtual Int hash()
Return toStr.hash
Int major()
Get the first, most significant segment which represents the major version.
static new make(Int[] segments)
Construct with list of integer segments. Throw ArgErr if segments is empty or contains negative numbers.
Int? minor()
Get the second segment which represents the minor version. Return null if version has less than two segments.
Int? patch()
Get the fourth segment which represents the patch number. Return null if version has less than four segments.
Int[] segments()
Get a readonly list of the integer segments.
virtual Str toStr()
The string format is equivalent to segments.join(".")