Package org.jivesoftware.smackx.xdata
Class BooleanFormField
java.lang.Object
org.jivesoftware.smackx.xdata.FormField
org.jivesoftware.smackx.xdata.SingleValueFormField
org.jivesoftware.smackx.xdata.BooleanFormField
- All Implemented Interfaces:
Element
,NamedElement
,XmlElement
,XmlLangElement
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jivesoftware.smackx.xdata.FormField
FormField.Description, FormField.Option, FormField.Required, FormField.Type, FormField.Value
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
boolean
Get the value of the boolean field.Get the value of the boolean field or maybenull
.Methods inherited from class org.jivesoftware.smackx.xdata.SingleValueFormField
getRawValue, getRawValues, getValues, populateExtraXmlChildElements
Methods inherited from class org.jivesoftware.smackx.xdata.FormField
asHiddenFormTypeFieldIfPossible, booleanBuilder, builder, buildHiddenFormType, equals, fixedBuilder, fixedBuilder, getDescription, getElementName, getFieldName, getFirstValue, getFirstValueAsDate, getFormFieldChildElement, getFormFieldChildElements, getFormFieldChildElements, getLabel, getNamespace, getQName, getRawValueCharSequences, getType, getValuesAsString, hashCode, hasValueSet, hiddenBuilder, ifPossibleAs, ifPossibleAsOrThrow, isRequired, jidMultiBuilder, jidSingleBuilder, listMultiBuilder, listSingleBuilder, textMultiBuilder, textPrivateBuilder, textSingleBuilder, toXML, toXML
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage
-
Constructor Details
-
BooleanFormField
-
-
Method Details
-
getValue
- Specified by:
getValue
in classSingleValueFormField
-
getValueAsBoolean
Get the value of the boolean field. Note that, if no explicit boolean value is provided, in the form of "true", "false", "0", or "1", then the default value of a boolean field isfalse
, according to XEP-0004 ยง 3.3.- Returns:
- the boolean value of this form field.
-
getValueAsBooleanOrNull
Get the value of the boolean field or maybenull
. Note that you usually want to usegetValueAsBoolean()
instead of this method, asgetValueAsBoolean()
considers the default value of boolean fields. That is, boolean form fields have the valuefalse
if not explicitly set to something else.- Returns:
- the boolean value of this form field or
null
if no value was explicitly provided. - Since:
- 4.4.5
- See Also:
-
asBuilder
-