Class BooleanFormField

All Implemented Interfaces:
org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

public class BooleanFormField extends SingleValueFormField
  • Constructor Details

  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in class SingleValueFormField
    • getValueAsBoolean

      public boolean 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 is false, according to XEP-0004 ยง 3.3.
      Returns:
      the boolean value of this form field.
    • getValueAsBooleanOrNull

      public Boolean getValueAsBooleanOrNull()
      Get the value of the boolean field or maybe null. Note that you usually want to use getValueAsBoolean() instead of this method, as getValueAsBoolean() considers the default value of boolean fields. That is, boolean form fields have the value false 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

      public BooleanFormField.Builder asBuilder()