@sap-cloud-sdk/odata-common
Version:
SAP Cloud SDK for JavaScript common functions of OData client generator and OpenAPI clint generator.
48 lines • 2.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderableEdmTypeField = void 0;
const filter_1 = require("../filter");
const edm_type_field_1 = require("./edm-type-field");
/**
* {@link EdmTypeField}, that represents a property with an EDM type, that can be compared with `greaterThan`, `greaterOrEqual`, `lessThan` and `lessOrEqual`.
* @template EntityT - Type of the entity the field belongs to.
* @template EdmT - EDM type of the field.
* @template NullableT - Boolean type that represents whether the field is nullable.
* @template SelectableT - Boolean type that represents whether the field is selectable.
*/
class OrderableEdmTypeField extends edm_type_field_1.EdmTypeField {
/**
* Creates an instance of Filter for this field and the given value using the operator 'gt', i.e. `>`.
* @param value - Value to be used in the filter.
* @returns The resulting filter.
*/
greaterThan(value) {
return new filter_1.Filter(this.fieldPath(), 'gt', value, this.edmType);
}
/**
* Creates an instance of Filter for this field and the given value using the operator 'ge', i.e. `>=`.
* @param value - Value to be used in the filter.
* @returns The resulting filter.
*/
greaterOrEqual(value) {
return new filter_1.Filter(this.fieldPath(), 'ge', value, this.edmType);
}
/**
* Creates an instance of Filter for this field and the given value using the operator 'lt', i.e. `<`.
* @param value - Value to be used in the filter.
* @returns The resulting filter.
*/
lessThan(value) {
return new filter_1.Filter(this.fieldPath(), 'lt', value, this.edmType);
}
/**
* Creates an instance of Filter for this field and the given value using the operator 'le', i.e. `<=`.
* @param value - Value to be used in the filter.
* @returns The resulting filter.
*/
lessOrEqual(value) {
return new filter_1.Filter(this.fieldPath(), 'le', value, this.edmType);
}
}
exports.OrderableEdmTypeField = OrderableEdmTypeField;
//# sourceMappingURL=orderable-edm-type-field.js.map