UNPKG

@sap/odata-v4

Version:

OData V4.0 server library

82 lines (71 loc) 1.96 kB
'use strict'; /** * @hideconstructor */ class SelectItem { /** Create a select item. */ constructor() { this._path = []; this._isAll = false; this._allOperationsInSchemaNamespace = null; } /** * Return the path segments. * @returns {UriResource[]} the path segments */ getPathSegments() { return this._path; } /** * Set the path segments. * @param {UriResource[]} path the path segments * @returns {SelectItem} this select item * @package */ setPathSegments(path) { this._path = path; return this; } /** * Return whether '*' has been specified for the (potentially empty) path. * @returns {boolean} whether '*' has been specified */ isAll() { return this._isAll; } /** * Set the information whether '*' has been specified. * @param {boolean} isAll whether '*' has been specified * @returns {SelectItem} this select item * @package */ setAll(isAll) { this._isAll = isAll; return this; } /** * Return whether all operations in a schema have been selected. * @returns {boolean} whether all operations in a schema have been selected */ isAllOperationsInSchema() { return this._allOperationsInSchemaNamespace != null; } /** * Return the namespace for which all operations have been selected. * @returns {?string} the namespace */ getAllOperationsInSchemaNamespace() { return this._allOperationsInSchemaNamespace; } /** * Set the schema namespace for which all operations have been selected. * @param {string} namespace the namespace * @returns {SelectItem} this select item * @package */ setAllOperationsInSchema(namespace) { this._allOperationsInSchemaNamespace = namespace; return this; } } module.exports = SelectItem;