UNPKG

3.65 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 if (typeof b !== "function" && b !== null)
11 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16})();
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.OrderableFilterFunction = void 0;
19var filter_1 = require("./filter");
20var filter_function_base_1 = require("./filter-function-base");
21/**
22 * Representation of a filter function, that returns a value of an orderable type. This supports int, double and decimal values.
23 */
24var OrderableFilterFunction = /** @class */ (function (_super) {
25 __extends(OrderableFilterFunction, _super);
26 /**
27 * Creates an instance of OrderableFilterFunction.
28 * @param functionName - Name of the function that returns a numeric value
29 * @param parameters - Representation of the parameters passed to the filter function
30 * @param edmType - Type of the returned numeric value. This influences the formatting of the returned value.
31 */
32 function OrderableFilterFunction(functionName, parameters, edmType) {
33 return _super.call(this, functionName, parameters, edmType) || this;
34 }
35 /**
36 * Creates an instance of Filter for this filter function and the given value using the operator 'gt', i.e. `>`.
37 * @param value - Value to be used in the filter
38 * @param edmType - EDM type of the field to filter on
39 * @returns The resulting filter
40 */
41 OrderableFilterFunction.prototype.greaterThan = function (value) {
42 return new filter_1.Filter(this, 'gt', value, this.edmType);
43 };
44 /**
45 * Creates an instance of Filter for this filter function and the given value using the operator 'ge', i.e. `>=`.
46 * @param value - Value to be used in the filter
47 * @param edmType - EDM type of the field to filter on
48 * @returns The resulting filter
49 */
50 OrderableFilterFunction.prototype.greaterOrEqual = function (value) {
51 return new filter_1.Filter(this, 'ge', value, this.edmType);
52 };
53 /**
54 * Creates an instance of Filter for this filter function and the given value using the operator 'lt', i.e. `<`.
55 * @param value - Value to be used in the filter
56 * @param edmType - EDM type of the field to filter on
57 * @returns The resulting filter
58 */
59 OrderableFilterFunction.prototype.lessThan = function (value) {
60 return new filter_1.Filter(this, 'lt', value, this.edmType);
61 };
62 /**
63 * Creates an instance of Filter for this filter function and the given value using the operator 'le', i.e. `<=`.
64 * @param value - Value to be used in the filter
65 * @param edmType - EDM type of the field to filter on
66 * @returns The resulting filter
67 */
68 OrderableFilterFunction.prototype.lessOrEqual = function (value) {
69 return new filter_1.Filter(this, 'le', value, this.edmType);
70 };
71 return OrderableFilterFunction;
72}(filter_function_base_1.FilterFunction));
73exports.OrderableFilterFunction = OrderableFilterFunction;
74//# sourceMappingURL=orderable-filter-function.js.map
\No newline at end of file