abstract class sap.ui.model.odata.type.Int

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/model/odata/type/Int
Application Component: CA-UI5-COR

This is an abstract base class for integer-based OData primitive types like Edm.Int16 or Edm.Int32.


Constructor

Constructor for a new Int.

new sap.ui.model.odata.type.Int(oFormatOptions?, oConstraints?)
Param Type Default Value Description
oFormatOptions? object

type-specific format options; see subtypes

oConstraints? object

constraints; validateValue throws an error if any constraint is violated

nullable? boolean string true

if true, the value null is accepted


Methods Overview

Method Description
sap.ui.model.odata.type.Int.extend

Creates a new subclass of class sap.ui.model.odata.type.Int with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.model.odata.type.ODataType.extend.

formatValue

Formats the given value to the given target type. When formatting to string the format options are used.

sap.ui.model.odata.type.Int.getMetadata

Returns a metadata object for class sap.ui.model.odata.type.Int.

parseValue

Parses the given value, which is expected to be of the given source type, to an Int in number representation.

validateValue

Validates whether the given value in model representation is valid and meets the defined constraints.

sap.ui.model.odata.type.Int.extend

Creates a new subclass of class sap.ui.model.odata.type.Int with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.model.odata.type.ODataType.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

formatValue

Formats the given value to the given target type. When formatting to string the format options are used.

Param Type DefaultValue Description
iValue number

the value in model representation to be formatted

sTargetType string

the target type; may be "any", "int", "float", "string", or a type with one of these types as its primitive type. See sap.ui.model.odata.type for more information.

sap.ui.model.odata.type.Int.getMetadata

Returns a metadata object for class sap.ui.model.odata.type.Int.

parseValue

Parses the given value, which is expected to be of the given source type, to an Int in number representation.

Param Type DefaultValue Description
vValue number string

the value to be parsed. The empty string and null are parsed to null.

sSourceType string

the source type (the expected type of vValue); may be "float", "int", "string", or a type with one of these types as its primitive type. See sap.ui.model.odata.type for more information.

validateValue

Validates whether the given value in model representation is valid and meets the defined constraints.

Param Type DefaultValue Description
iValue number

the value to be validated