toJson method
Serializes the object to its JSON representation.
Implementation
@override
toJson() {
if (additionalProperties.isEmpty &&
localizedName == null &&
identifier == null &&
altIdentifiers == null &&
localizedSortAs == null &&
(links == null || links!.isEmpty) &&
(articles.isEmpty) &&
(chapters.isEmpty)) {
return position;
} else {
return <String, dynamic>{...additionalProperties}
..put('position', position)
..putIterableIfNotEmpty('altIdentifier', altIdentifiers.toJsonList())
..putJSONableIfNotEmpty('name', localizedName)
..putJSONableIfNotEmpty('sortAs', localizedSortAs)
..putIterableIfNotEmpty('links', links)
..putOpt('article', articles.toSingleOrMultiJson())
..putOpt('chapter', chapters.toSingleOrMultiJson());
}
}