Kgapi
12#include "fieldmetadata.h"
13#include "peopleservice.h"
22namespace KGAPI2::People
24class Interest::Private :
public QSharedData
27 explicit Private() =
default;
28 Private(
const Private &) =
default;
29 Private(Private &&) noexcept = delete;
30 Private &operator=(const Private &) = delete;
31 Private &operator=(Private &&) noexcept = delete;
34 bool operator==(const Private &other)
const
36 return value == other.value && metadata == other.metadata;
39 bool operator!=(
const Private &other)
const
41 return !(*
this == other);
45 FieldMetadata metadata{};
61 return *d == *other.d;
64bool Interest::operator!=(
const Interest &other)
const
66 return !(*
this == other);
95 interest.
setValue(obj.
value(QStringLiteral(
"value")).toString());
105 for(
const auto &interest : data) {
106 if(interest.isObject()) {
107 const auto objectifiedInterest = interest.toObject();
108 interests.
append(fromJSON(objectifiedInterest));
115QJsonValue Interest::toJSON()
const
119 PeopleUtils::addValueToJsonObjectIfValid(obj,
"value", d->value);
One of the person's interests.
void setMetadata(const FieldMetadata &value)
Sets value of the metadata property.
QString value() const
The interest; for example, stargazing.
FieldMetadata metadata() const
Metadata about the interest.
void setValue(const QString &value)
Sets value of the value property.
Interest()
Constructs a new Interest.
bool isEmpty() const const
QJsonValue value(QLatin1StringView key) const const
QJsonObject toObject() const const
void append(QList< T > &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:31 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.