Class: Version

Version

Version wrapper.


new Version(major, minor, maintenance [, releaseType])

Parameters:
Name Type Argument Description
major number

The major version number

minor number

The minor version number

maintenance number

The maintenance version number

releaseType string <optional>

The optional release type string

Members


<static, non-null> INVALID :olympe.utils.Version

A reusable instance representing an invalid version.

Type:

Methods


<static> parse(str)

Creates a new Version from the provided string.

Parameters:
Name Type Description
str string

The version string with formats: X.X.X, eg. 1.0.1 X.X.X-optionalReleaseType, eg. 1.0.1-CI-SNAPSHOT X.X.Xflag, eg. 1.0.1b

Returns:
Type
olympe.utils.Version

equals(version)

Returns true if the given version is equals to this version. ReleaseType field is not taken into account.

Parameters:
Name Type Description
version olympe.utils.Version
Returns:
Type
boolean

getMaintenance()

Get the maintenance release number

Returns:
Type
number

getMajor()

Get the major release number

Returns:
Type
number

getMinor()

Get the minor release number

Returns:
Type
number

greaterThan(version)

Returns true if this version is greater than the given version.

Parameters:
Name Type Description
version olympe.utils.Version
Returns:
Type
boolean

greaterThanOrEquals(version)

Returns true if the given version is greater than or equals to this version. ReleaseType field is not taken into account.

Parameters:
Name Type Description
version olympe.utils.Version
Returns:
Type
boolean

smallerThan(version)

Returns true if this version is smaller than the given version. ReleaseType field is not taken into account.

Parameters:
Name Type Description
version olympe.utils.Version
Returns:
Type
boolean

smallerThanOrEquals(version)

Returns true if the given version is smaller than or equals to this version. ReleaseType field is not taken into account.

Parameters:
Name Type Description
version olympe.utils.Version
Returns:
Type
boolean

toShortString()

Return the version with format X.X.X, ignoring the releaseType.

Returns:
Type
string

toString()

Return the version with format X.X.X-optionalReleaseType.

Returns:
Type
string