@configurator/ravendb
Version:
RavenDB client for Node.js
32 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeSeriesEntry = void 0;
const Exceptions_1 = require("../../../Exceptions");
const TypedTimeSeriesEntry_1 = require("./TypedTimeSeriesEntry");
const TimeSeriesValuesHelper_1 = require("./TimeSeriesValuesHelper");
class TimeSeriesEntry {
get value() {
if (this.values.length === 1) {
return this.values[0];
}
(0, Exceptions_1.throwError)("InvalidOperationException", "Entry has more than one value.");
}
set value(value) {
if (this.values.length === 1) {
this.values[0] = value;
return;
}
(0, Exceptions_1.throwError)("InvalidOperationException", "Entry has more than one value.");
}
asTypedEntry(clazz) {
const entry = new TypedTimeSeriesEntry_1.TypedTimeSeriesEntry();
entry.isRollup = this.isRollup;
entry.tag = this.tag;
entry.timestamp = this.timestamp;
entry.values = this.values;
entry.value = TimeSeriesValuesHelper_1.TimeSeriesValuesHelper.setFields(clazz, this.values, this.isRollup);
return entry;
}
}
exports.TimeSeriesEntry = TimeSeriesEntry;
//# sourceMappingURL=TimeSeriesEntry.js.map