Search in sources :

Example 1 with BooleanFormField

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

the class FormReader method readBoolean.

default Boolean readBoolean(String fieldName) {
    FormField formField = getField(fieldName);
    if (formField == null) {
        return null;
    }
    BooleanFormField booleanFormField = formField.ifPossibleAs(BooleanFormField.class);
    return booleanFormField.getValueAsBoolean();
}
Also used : BooleanFormField(org.jivesoftware.smackx.xdata.BooleanFormField) 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