@sap/odata-v4
Version:
OData V4.0 server library
60 lines (51 loc) • 1.42 kB
JavaScript
;
const Transformation = require('./Transformation');
/**
* Custom-function transformation.
*
* @extends Transformation
* @hideconstructor
*/
class CustomFunctionTransformation extends Transformation {
constructor() {
super(Transformation.TransformationKind.CUSTOM_FUNCTION);
this._function = null;
this._parameters = [];
}
/**
* Return the custom function or null if there is none.
* @returns {?EdmFunction} the custom function or null
*/
getFunction() {
return this._function;
}
/**
* Set the custom function.
*
* @param {EdmFunction} func the function
* @returns {CustomFunctionTransformation} this custom-function transformation
* @package
*/
setFunction(func) {
this._function = func;
return this;
}
/**
* Return the custom-function parameters.
* @returns {UriParameter[]} an array of UriParameter
*/
getParameters() {
return this._parameters;
}
/**
* Set the custom-function parameters.
* @param {UriParameter[]} parameters the custom-function parameters to set
* @returns {CustomFunctionTransformation} this custom-function transformation
* @package
*/
setParameters(parameters) {
this._parameters = parameters;
return this;
}
}
module.exports = CustomFunctionTransformation;