const class sys::Version

sys::Obj
  sys::Version

@Serializable { simple=true }

Source

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.

build

Int? build()

Source

Get the third segment which represents the build number. Return null if version has less than three segments.

compare

virtual override Int compare(Obj obj)

Source

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
defVal

const static Version defVal

Source

Default value is "0".

equals

virtual override Bool equals(Obj? obj)

Source

Return true if equal segments.

fromStr

static new fromStr(Str version, Bool checked := true)

Source

Parse a string representation into a Version. If invalid format and checked is false return null, otherwise throw ParseErr.

hash

virtual override Int hash()

Source

Return toStr.hash

major

Int major()

Source

Get the first, most significant segment which represents the major version.

make

static new make(Int[] segments)

Source

Construct with list of integer segments. Throw ArgErr if segments is empty or contains negative numbers.

minor

Int? minor()

Source

Get the second segment which represents the minor version. Return null if version has less than two segments.

patch

Int? patch()

Source

Get the fourth segment which represents the patch number. Return null if version has less than four segments.

segments

Int[] segments()

Source

Get a readonly list of the integer segments.

toStr

virtual override Str toStr()

Source

The string format is equivalent to segments.join(".")