Map<String, dynamic> toMap() { return <String, dynamic>{ 'inverted': inverted, 'threshold': threshold, 'type': type, }; }