Class sap.ui.model.odata.type.TimeOfDayModule: sap/ui/model/odata/type/TimeOfDay

extends ODataType

This class represents the OData V4 primitive type Edm.TimeOfDay. In sap.ui.model.odata.v4.ODataModel this type is represented as a string.


Since: 1.37.0.
Constructor Summary
new sap.ui.model.odata.type.TimeOfDay(oFormatOptions?, oConstraints?)Constructor for an OData primitive type Edm.TimeOfDay.
Method Summary
sap.ui.model.odata.type.TimeOfDay.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.odata.type.TimeOfDay with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.model.odata.type.TimeOfDay.getMetadata()Returns a metadata object for class sap.ui.model.odata.type.TimeOfDay.
formatValue(sValue, sTargetType)Formats the given value to the given target type.
getName()Returns the type's name.
parseValue(sValue, sSourceType)Parses the given value, which is expected to be of the given type, to a string with an OData V4 Edm.TimeOfDay value.
validateValue(sValue)Validates the given value in model representation and meets the type's constraints.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.odata.type.TimeOfDay(oFormatOptions?, oConstraints?)
Constructor for an OData primitive type Edm.TimeOfDay.
Parameters:
{object}oFormatOptions? Format options as defined in sap.ui.core.format.DateFormat
{object}oConstraints? Constraints; validateValue throws an error if any constraint is violated
{boolean}oConstraints.nullable?, Default: true If true, the value null is accepted
{number}oConstraints.precision? The number of decimal places allowed in the seconds portion of a valid value; must be an integer between 0 and 12, otherwise the default value 0 is used.
Method Detail
sap.ui.model.odata.type.TimeOfDay.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.odata.type.TimeOfDay 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.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.model.odata.type.TimeOfDay.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.odata.type.TimeOfDay.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
formatValue(sValue, sTargetType): string
Formats the given value to the given target type.
Parameters:
{string}sValue The value to be formatted, which is represented as a string in the model
{string}sTargetType The target type, may be "any" or "string"; see sap.ui.model.odata.type for more information
Since:
1.37.0
Exceptions:
{sap.ui.model.FormatException} If sValue is not a valid OData V4 Edm.TimeOfDay value or if sTargetType is not supported
Returns:
{string} The formatted output value in the target type; undefined or null are formatted to null
getName(): string
Returns the type's name.
Since:
1.37.0
Returns:
{string} The type's name
parseValue(sValue, sSourceType): string
Parses the given value, which is expected to be of the given type, to a string with an OData V4 Edm.TimeOfDay value.
Parameters:
{string}sValue The value to be parsed, maps "" to null
{string}sSourceType The source type (the expected type of sValue), must be "string"; see sap.ui.model.odata.type for more information.
Since:
1.37.0
Exceptions:
{sap.ui.model.ParseException} If sSourceType is not supported or if the value is invalid and cannot be parsed
Returns:
{string} The parsed value
validateValue(sValue): void
Validates the given value in model representation and meets the type's constraints.
Parameters:
{string}sValue The value to be validated
Since:
1.37.0
Exceptions:
{sap.ui.model.ValidateException} If the value is not valid