21 lines
480 B
JavaScript
21 lines
480 B
JavaScript
|
export default class Monitor {
|
||
|
constructor(data) {
|
||
|
this._id = data?.id;
|
||
|
this._modelName = data?.modelName;
|
||
|
}
|
||
|
|
||
|
get id() {
|
||
|
return this._id;
|
||
|
}
|
||
|
|
||
|
get modelName() {
|
||
|
return this._modelName;
|
||
|
}
|
||
|
|
||
|
set modelName(value) {
|
||
|
if (typeof value !== 'string' || value === null || value.length == 0) {
|
||
|
throw 'New model name value ' + value + ' is not a string or empty';
|
||
|
}
|
||
|
this._modelName = value;
|
||
|
}
|
||
|
}
|