@override Object toJson() => { if (nearestNeighbors case final nearestNeighbors?) 'nearestNeighbors': nearestNeighbors.toJson(), };