Class DataForm.Builder

  • Enclosing class:
    DataForm

    public static final class DataForm.Builder
    extends java.lang.Object
    • Method Detail

      • setTitle

        public DataForm.Builder setTitle​(java.lang.String title)
        Sets the description of the data. It is similar to the title on a web page or an X window. You can put a <title/> on either a form to fill out, or a set of data results.
        Parameters:
        title - description of the data.
        Returns:
        a reference to this builder.
      • addField

        public DataForm.Builder addField​(FormField field)
        Adds a new field as part of the form.
        Parameters:
        field - the field to add to the form.
        Returns:
        a reference to this builder.
      • addFields

        public DataForm.Builder addFields​(java.util.Collection<? extends FormField> fieldsToAdd)
        Add the given fields to this form.
        Parameters:
        fieldsToAdd - TODO javadoc me please
        Returns:
        a reference to this builder.
      • removeField

        public DataForm.Builder removeField​(java.lang.String fieldName)
      • setFormType

        public DataForm.Builder setFormType​(java.lang.String formType)
      • setInstructions

        public DataForm.Builder setInstructions​(java.lang.String instructions)
      • setInstructions

        public DataForm.Builder setInstructions​(java.util.List<java.lang.String> instructions)
        Sets the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.
        Parameters:
        instructions - list of instructions that explain how to fill out the form.
        Returns:
        a reference to this builder.
      • addInstruction

        public DataForm.Builder addInstruction​(java.lang.String instruction)
        Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.
        Parameters:
        instruction - the new instruction that explain how to fill out the form.
        Returns:
        a reference to this builder.
      • addItem

        public DataForm.Builder addItem​(DataForm.Item item)
        Adds a new item returned from a search.
        Parameters:
        item - the item returned from a search.
        Returns:
        a reference to this builder.
      • setReportedData

        public DataForm.Builder setReportedData​(DataForm.ReportedData reportedData)
        Sets the fields that will be returned from a search.
        Parameters:
        reportedData - the fields that will be returned from a search.
        Returns:
        a reference to this builder.
      • addExtensionElement

        public DataForm.Builder addExtensionElement​(org.jivesoftware.smack.packet.Element element)