UNPKG

@sap/odata-v4

Version:

OData V4.0 server library

49 lines (42 loc) 1.14 kB
'use strict'; const AbstractEdmFaceted = require('./AbstractEdmFaceted'); const EdmTypeKind = require('./EdmType').TypeKind; /** * * * <a href="./../ODataSpecification/odata-v4.0-errata03-os/complete/part3-csdl/odata-v4.0-errata03-os-part3-csdl-complete.html#_Toc453752525"> * OData CSDL # 6.1 Element edm:Property * </a> * @extends AbstractEdmFaceted * @hideconstructor */ class EdmProperty extends AbstractEdmFaceted { /** * Constructor * @param {Edm} edm The edm itself * @param {CsdlProperty} property */ constructor(edm, property) { super(edm, property); } /** * Returns the name. * @returns {string} */ getName() { return this._csdlObject.name; } /** * Return the default value of the property. * @returns {*} */ getDefaultValue() { return this._csdlObject.defaultValue; } /** * Returns true if the parameter is primitive, false otherwise. * @returns {boolean} */ isPrimitive() { return this.getType().getKind() === EdmTypeKind.PRIMITIVE; } } module.exports = EdmProperty;