use of org.jivesoftware.smackx.xdata.AbstractSingleStringValueFormField in project Smack by igniterealtime.
the class FormReader method readInteger.
default Integer readInteger(String fieldName) {
FormField formField = getField(fieldName);
if (formField == null) {
return null;
}
AbstractSingleStringValueFormField textSingleFormField = formField.ifPossibleAs(AbstractSingleStringValueFormField.class);
return textSingleFormField.getValueAsInt();
}
use of org.jivesoftware.smackx.xdata.AbstractSingleStringValueFormField in project Smack by igniterealtime.
the class FormReader method readDate.
default Date readDate(String fieldName) throws ParseException {
FormField formField = getField(fieldName);
if (formField == null) {
return null;
}
AbstractSingleStringValueFormField textSingleFormField = formField.ifPossibleAs(AbstractSingleStringValueFormField.class);
String value = textSingleFormField.getValue();
if (value == null) {
return null;
}
return XmppDateTime.parseDate(value);
}
Aggregations