1 | "use strict";
|
2 | var __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 | })();
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.EnumField = void 0;
|
19 | var filter_1 = require("../filter");
|
20 | var field_1 = require("./field");
|
21 | var complex_type_field_1 = require("./complex-type-field");
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | var EnumField = (function (_super) {
|
30 | __extends(EnumField, _super);
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | function EnumField(fieldName, _fieldOf, enumType, fieldOptions) {
|
39 | var _this = _super.call(this, fieldName, (0, complex_type_field_1.getEntityConstructor)(_fieldOf), fieldOptions) || this;
|
40 | _this._fieldOf = _fieldOf;
|
41 | _this.enumType = enumType;
|
42 | |
43 |
|
44 |
|
45 | _this.edmType = 'Edm.Enum';
|
46 | return _this;
|
47 | }
|
48 | |
49 |
|
50 |
|
51 |
|
52 | EnumField.prototype.fieldPath = function () {
|
53 | return this._fieldOf instanceof complex_type_field_1.ComplexTypeField
|
54 | ? "".concat(this._fieldOf.fieldPath(), "/").concat(this._fieldName)
|
55 | : this._fieldName;
|
56 | };
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 | EnumField.prototype.equals = function (value) {
|
63 | return new filter_1.Filter(this.fieldPath(), 'eq', value, this.edmType);
|
64 | };
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | EnumField.prototype.notEquals = function (value) {
|
71 | return new filter_1.Filter(this.fieldPath(), 'eq', value, this.edmType);
|
72 | };
|
73 | return EnumField;
|
74 | }(field_1.Field));
|
75 | exports.EnumField = EnumField;
|
76 |
|
\ | No newline at end of file |