class jQuery.sap.Version

Control sample: jQuery.sap.Version
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends:
Module: jquery.sap.global
Application Component: CA-UI5-COR

Represents a version consisting of major, minor, patch version and suffix, e.g. '1.2.7-SNAPSHOT'.


Constructor

Returns a Version instance created from the given parameters.

This function can either be called as a constructor (using new) or as a normal function. It always returns an immutable Version instance.

The parts of the version number (major, minor, patch, suffix) can be provided in several ways:

To keep the code size small, this implementation mainly validates the single string variant. All other variants are only validated to some degree. It is the responsibility of the caller to provide proper parts.

new jQuery.sap.Version(vMajor, iMinor, iPatch, sSuffix)
Param Type Default Value Description
vMajor int string any[] jQuery.sap.Version

the major part of the version (int) or any of the single parameter variants explained above.

iMinor int

the minor part of the version number

iPatch int

the patch part of the version number

sSuffix string

the suffix part of the version number


Methods Overview

Method Description
compareTo

Compares this version with a given one.

The version with which this version should be compared can be given as a jQuery.sap.Version instance, as a string (e.g. v.compareto("1.4.5")). Or major, minor, patch and suffix values can be given as separate parameters (e.g. v.compareTo(1, 4, 5)) or in an array (e.g. v.compareTo([1, 4, 5])).

getMajor

Returns the major version part of this version.

getMinor

Returns the minor version part of this version.

getPatch

Returns the patch (or micro) version part of this version.

getSuffix

Returns the version suffix of this version.

inRange

Checks whether this version is in the range of the given interval (start inclusive, end exclusive).

The boundaries against which this version should be checked can be given as jQuery.sap.Version instances (e.g. v.inRange(v1, v2)), as strings (e.g. v.inRange("1.4", "2.7")) or as arrays (e.g. v.inRange([1,4], [2,7])).

toString

Returns a string representation of this version.

compareTo

Compares this version with a given one.

The version with which this version should be compared can be given as a jQuery.sap.Version instance, as a string (e.g. v.compareto("1.4.5")). Or major, minor, patch and suffix values can be given as separate parameters (e.g. v.compareTo(1, 4, 5)) or in an array (e.g. v.compareTo([1, 4, 5])).

getMajor

Returns the major version part of this version.

getMinor

Returns the minor version part of this version.

getPatch

Returns the patch (or micro) version part of this version.

getSuffix

Returns the version suffix of this version.

inRange

Checks whether this version is in the range of the given interval (start inclusive, end exclusive).

The boundaries against which this version should be checked can be given as jQuery.sap.Version instances (e.g. v.inRange(v1, v2)), as strings (e.g. v.inRange("1.4", "2.7")) or as arrays (e.g. v.inRange([1,4], [2,7])).

Param Type DefaultValue Description
vMin string any[] jQuery.sap.Version

the start of the range (inclusive)

vMax string any[] jQuery.sap.Version

the end of the range (exclusive)

toString

Returns a string representation of this version.