UNPKG

@sap-cloud-sdk/core

Version:
108 lines 4.92 kB
"use strict"; /* eslint-disable max-classes-per-file */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ComplexTypeNumberPropertyField = exports.NumberField = exports.NumberFieldBase = void 0; var filter_1 = require("../../filter"); var complex_type_field_1 = require("../complex-type-field"); var edm_type_field_1 = require("../edm-type-field"); /** * @deprecated Since v1.47.0. Use [[OrderableEdmTypeField]] instead. * Represents a property with a number value. * @typeparam EntityT - Type of the entity the field belongs to */ var NumberFieldBase = /** @class */ (function (_super) { __extends(NumberFieldBase, _super); function NumberFieldBase() { return _super !== null && _super.apply(this, arguments) || this; } /** * Creates an instance of Filter for this field and the given value using the operator 'gt', i.e. `>`. * @param value - Value to be used in the filter * @returns The resulting filter */ NumberFieldBase.prototype.greaterThan = function (value) { return new filter_1.Filter(this.fieldPath(), 'gt', value, this.edmType); }; /** * Creates an instance of Filter for this field and the given value using the operator 'ge', i.e. `>=`. * @param value - Value to be used in the filter * @returns The resulting filter */ NumberFieldBase.prototype.greaterOrEqual = function (value) { return new filter_1.Filter(this.fieldPath(), 'ge', value, this.edmType); }; /** * Creates an instance of Filter for this field and the given value using the operator 'lt', i.e. `<`. * @param value - Value to be used in the filter * @returns The resulting filter */ NumberFieldBase.prototype.lessThan = function (value) { return new filter_1.Filter(this.fieldPath(), 'lt', value, this.edmType); }; /** * Creates an instance of Filter for this field and the given value using the operator 'le', i.e. `<=`. * @param value - Value to be used in the filter * @returns The resulting filter */ NumberFieldBase.prototype.lessOrEqual = function (value) { return new filter_1.Filter(this.fieldPath(), 'le', value, this.edmType); }; return NumberFieldBase; }(edm_type_field_1.EdmTypeField)); exports.NumberFieldBase = NumberFieldBase; /** * @deprecated Since v1.47.0. Use [[OrderableEdmTypeField]] instead. * Represents a selectable property with a number value. * @typeparam EntityT - Type of the entity the field belongs to */ var NumberField = /** @class */ (function (_super) { __extends(NumberField, _super); function NumberField() { return _super !== null && _super.apply(this, arguments) || this; } return NumberField; }(NumberFieldBase)); exports.NumberField = NumberField; /** * @deprecated Since v1.47.0. Use [[OrderableEdmTypeField]] instead. * Represents a complex type property with a number value. * @typeparam EntityT - Type of the entity the field belongs to */ var ComplexTypeNumberPropertyField = /** @class */ (function (_super) { __extends(ComplexTypeNumberPropertyField, _super); /* * Union of the two possible constructors. */ function ComplexTypeNumberPropertyField(fieldName, fieldOf, arg3, arg4) { var _this = _super.call(this, fieldName, (0, complex_type_field_1.getEntityConstructor)(fieldOf), (0, complex_type_field_1.getEdmType)(arg3, arg4)) || this; _this.fieldOf = fieldOf; return _this; } /** * Path to the field to be used in filter and order by queries. Combines the parent complex type name with the field name. * @returns Path to the field to be used in filter and order by queries. */ ComplexTypeNumberPropertyField.prototype.fieldPath = function () { return this.fieldOf instanceof complex_type_field_1.ComplexTypeField ? "".concat(this.fieldOf.fieldPath(), "/").concat(this._fieldName) : this._fieldName; }; return ComplexTypeNumberPropertyField; }(NumberFieldBase)); exports.ComplexTypeNumberPropertyField = ComplexTypeNumberPropertyField; //# sourceMappingURL=number-field.js.map