In Smack 4.3, it’s rather cumbersome to create a FormField and populate it with a value (typical use case):
FormField formField = new FormField(FORM_FIELD_START);
formField.addValue(start);
formFields.put(formField.getVariable(), formField);
FormField endFormField = formFields.get(FORM_FIELD_END);
....
It would be awesome to have either FormField.addValue() return this
, or have a default constructor for a single-value field (there are three different methods to add values, but I’m primarily interested in the string variant):
// option a
formFields.addField(new Field(FORM_FIELD_START).addValue(start));
// option b
formFields.addField(new Field(FORM_FIELD_START, start));
Bonus points for a dedicated helper method to create the hidden FORM_TYPE value.