Map<String, dynamic> toJson() { final fieldName = this.fieldName; final sortOrder = this.sortOrder; return { 'fieldName': fieldName, if (sortOrder != null) 'sortOrder': sortOrder.toValue(), }; }