@sap/odata-v4
Version:
OData V4.0 server library
55 lines (47 loc) • 1.22 kB
JavaScript
;
/**
* @hideconstructor
*/
class OrderByItem {
/** Create an orderby item. */
constructor() {
this._expression = null;
// default sort order is ascending
this._descending = false;
}
/**
* Return the sort order: true if descending, false if ascending.
* @returns {boolean} true if descending, false if ascending
*/
isDescending() {
return this._descending;
}
/**
* Set the sort order.
* @param {boolean} descending true if the sort order is descending, false if ascending
* @returns {OrderByItem} this instance of OrderByItem
* @package
*/
setDescending(descending) {
this._descending = descending;
return this;
}
/**
* Return the sort expression.
* @returns {Expression} sort expression
*/
getExpression() {
return this._expression;
}
/**
* Set the sort expression.
* @param {Expression} expression sort expression
* @returns {OrderByItem} this instance of OrderByItem
* @package
*/
setExpression(expression) {
this._expression = expression;
return this;
}
}
module.exports = OrderByItem;