@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
71 lines • 3.76 kB
JavaScript
"use strict";
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.CustomField = void 0;
var field_1 = require("./field");
var field_builder_1 = require("./field-builder");
var CustomField = /** @class */ (function (_super) {
__extends(CustomField, _super);
function CustomField(fieldName, entityConstructor, isNullable) {
if (isNullable === void 0) { isNullable = false; }
var _this = _super.call(this, fieldName, entityConstructor, { isNullable: isNullable }) || this;
_this.fieldBuilder = new field_builder_1.FieldBuilder(entityConstructor);
return _this;
}
CustomField.prototype.edmString = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.String', this._fieldOptions.isNullable);
};
CustomField.prototype.edmBoolean = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Boolean', this._fieldOptions.isNullable);
};
CustomField.prototype.edmGuid = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Guid', this._fieldOptions.isNullable);
};
CustomField.prototype.edmDecimal = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Decimal', this._fieldOptions.isNullable);
};
CustomField.prototype.edmInt16 = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Int16', this._fieldOptions.isNullable);
};
CustomField.prototype.edmInt32 = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Int32', this._fieldOptions.isNullable);
};
CustomField.prototype.edmInt64 = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Int64', this._fieldOptions.isNullable);
};
CustomField.prototype.edmSingle = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Single', this._fieldOptions.isNullable);
};
CustomField.prototype.edmDouble = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Double', this._fieldOptions.isNullable);
};
CustomField.prototype.edmByte = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Byte', this._fieldOptions.isNullable);
};
CustomField.prototype.edmSByte = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.SByte', this._fieldOptions.isNullable);
};
CustomField.prototype.edmDateTimeOffset = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.DateTimeOffset', this._fieldOptions.isNullable);
};
CustomField.prototype.edmBinary = function () {
return this.fieldBuilder.buildEdmTypeField(this._fieldName, 'Edm.Binary', this._fieldOptions.isNullable);
};
return CustomField;
}(field_1.Field));
exports.CustomField = CustomField;
//# sourceMappingURL=custom-field.js.map