@sap/odata-v4
Version:
OData V4.0 server library
50 lines (42 loc) • 1.15 kB
JavaScript
;
const Expression = require('./Expression');
/**
* Alias expression, i.e., usage of an alias name defined in a separate query option.
*
* @extends Expression
* @hideconstructor
*/
class AliasExpression extends Expression {
/**
* Create an instance of AliasExpression.
* @param {string} alias the alias name
* @param {Expression} expression an expression as the alias value
*/
constructor(alias, expression) {
super(Expression.ExpressionKind.ALIAS);
this._alias = alias;
this._expression = expression;
}
/**
* Return the alias name.
* @returns {?string} the alias name
*/
getAlias() {
return this._alias;
}
/**
* Return the alias value.
* @returns {Expression} the alias value
*/
getExpression() {
return this._expression;
}
/**
* Return the EDM type of this expression or null if there is none.
* @returns {?EdmType} the EDM type of this expression or null if there is none
*/
getType() {
return this._expression.getType();
}
}
module.exports = AliasExpression;