Map<String, dynamic> toMap() => <String, dynamic>{ "type": type.number, "minLength": minLength, "maxLength": maxLength, };