class sap.ui.model.odata.type.Boolean

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

This class represents the OData primitive type Edm.Boolean.

In both sap.ui.model.odata.v2.ODataModel and sap.ui.model.odata.v4.ODataModel this type is represented as a boolean.


Constructor

Constructor for an OData primitive type Edm.Boolean.

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

format options as defined in the interface of sap.ui.model.SimpleType; this type ignores them since it does not support any format options

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.Boolean.extend

Creates a new subclass of class sap.ui.model.odata.type.Boolean 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 boolean value to the given target type.

sap.ui.model.odata.type.Boolean.getMetadata

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

getName

Returns the type's name.

parseValue

Parses the given value from the given type to a boolean.

validateValue

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

sap.ui.model.odata.type.Boolean.extend

Creates a new subclass of class sap.ui.model.odata.type.Boolean 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 boolean value to the given target type.

Param Type DefaultValue Description
bValue boolean

the value to be formatted

sTargetType string

the target type; may be "any", "boolean", "string", or a type with one of these types as its primitive type. If the target type (or its primitive type) is "string", the result is "Yes" or "No" in the current language. See sap.ui.model.odata.type for more information.

sap.ui.model.odata.type.Boolean.getMetadata

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

getName

Returns the type's name.

parseValue

Parses the given value from the given type to a boolean.

Param Type DefaultValue Description
vValue boolean 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 "boolean", "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 given constraints.

Param Type DefaultValue Description
bValue boolean

the value to be validated