mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 16:20:39 +02:00
77 lines
1.6 KiB
C++
77 lines
1.6 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;
|
|
}
|
|
|
|
quint64 Entity::getLastUpdate() const {
|
|
return lastUpdate;
|
|
}
|
|
|
|
void Entity::setLastUpdate(quint64 lastUpdate) {
|
|
this->lastUpdate = lastUpdate;
|
|
}
|
|
|
|
quint64 Entity::getLastModified() const {
|
|
return lastModified;
|
|
}
|
|
|
|
void Entity::setLastModified(const quint64 &lastModified) {
|
|
this->lastModified = lastModified;
|
|
}
|
|
|
|
bool Entity::getDeleted() const
|
|
{
|
|
return deleted;
|
|
}
|
|
|
|
void Entity::setDeleted(const bool &deleted)
|
|
{
|
|
this->deleted = deleted;
|
|
}
|
|
|
|
QString Entity::idToStringWithoutBraces() const
|
|
{
|
|
const qint8 lengthOfUuid = 36;
|
|
return id.toString().mid(1, lengthOfUuid);
|
|
}
|
|
|
|
void Entity::fromJSON(const QJsonObject &json) {
|
|
id = json["id"].toString();
|
|
name = json["name"].toString();
|
|
description = json["description"].toString();
|
|
lastUpdate = json["lastUpdate"].toDouble();
|
|
}
|
|
|
|
QJsonObject Entity::toJSON() const {
|
|
QJsonObject json;
|
|
|
|
json["id"] = this->idToStringWithoutBraces();
|
|
json["name"] = name;
|
|
json["description"] = description;
|
|
json["lastUpdate"] = lastUpdate;
|
|
|
|
return json;
|
|
}
|