Search in sources :

Example 1 with AbstractMultiFormField

use of org.jivesoftware.smackx.xdata.AbstractMultiFormField in project Smack by igniterealtime.

the class FormReader method readStringValues.

default List<String> readStringValues(String fieldName) {
    FormField formField = getField(fieldName);
    if (formField == null) {
        return Collections.emptyList();
    }
    AbstractMultiFormField multiFormField = formField.ifPossibleAs(AbstractMultiFormField.class);
    List<? extends CharSequence> charSequences = multiFormField.getValues();
    return StringUtils.toStrings(charSequences);
}
Also used : AbstractMultiFormField(org.jivesoftware.smackx.xdata.AbstractMultiFormField) FormField(org.jivesoftware.smackx.xdata.FormField) AbstractSingleStringValueFormField(org.jivesoftware.smackx.xdata.AbstractSingleStringValueFormField) AbstractMultiFormField(org.jivesoftware.smackx.xdata.AbstractMultiFormField) BooleanFormField(org.jivesoftware.smackx.xdata.BooleanFormField)

Aggregations

AbstractMultiFormField (org.jivesoftware.smackx.xdata.AbstractMultiFormField)1 AbstractSingleStringValueFormField (org.jivesoftware.smackx.xdata.AbstractSingleStringValueFormField)1 BooleanFormField (org.jivesoftware.smackx.xdata.BooleanFormField)1 FormField (org.jivesoftware.smackx.xdata.FormField)1