mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 19:40:36 +02:00
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#include <QJsonObject>
|
|
#include "entity.h"
|
|
|
|
const QUuid &Entity::getId() const {
|
|
return id;
|
|
}
|
|
|
|
void Entity::setId(const QUuid &id) {
|
|
Entity::id = id;
|
|
}
|
|
|
|
const QString &Entity::getName() const {
|
|
return name;
|
|
}
|
|
|
|
void Entity::setName(const QString &name) {
|
|
Entity::name = name;
|
|
}
|
|
|
|
const QString &Entity::getDescription() const {
|
|
return description;
|
|
}
|
|
|
|
void Entity::setDescription(const QString &description) {
|
|
Entity::description = description;
|
|
}
|
|
|
|
uint64_t Entity::getLastUpdate() const {
|
|
return lastUpdate;
|
|
}
|
|
|
|
void Entity::setLastUpdate(uint64_t lastUpdate) {
|
|
this->lastUpdate = lastUpdate;
|
|
}
|
|
|
|
void Entity::fromJSON(const QJsonObject &json) {
|
|
id = json.value("id").toString();
|
|
name = json.value("name").toString();
|
|
description = json.value("description").toString();
|
|
lastUpdate = json.value("lastUpdate").toDouble();
|
|
}
|
|
|
|
QJsonObject Entity::toJSON() const {
|
|
QJsonObject json;
|
|
|
|
json.value("id") = id.toString();
|
|
json.value("name") = name;
|
|
json.value("description") = description;
|
|
json.value("lastUpdate") = lastUpdate;
|
|
|
|
return json;
|
|
}
|