@override Object toJson() { return { if (key != null) 'key': key, if (compositeKey != null) 'compositeKey': compositeKey!.toJson(), }; }