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