Class Version

    • Constructor Detail

      • Version

        public Version​(Jid to)
        Request version IQ.
        Parameters:
        to - the jid where to request version from
      • Version

        public Version​(java.lang.String name,
                       java.lang.String version)
      • Version

        public Version​(java.lang.String name,
                       java.lang.String version,
                       java.lang.String os)
        Creates a new Version object with given details.
        Parameters:
        name - The natural-language name of the software. This element is REQUIRED.
        version - The specific version of the software. This element is REQUIRED.
        os - The operating system of the queried entity. This element is OPTIONAL.
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the natural-language name of the software. This property will always be present in a result.
        Returns:
        the natural-language name of the software.
      • getVersion

        public java.lang.String getVersion()
        Returns the specific version of the software. This property will always be present in a result.
        Returns:
        the specific version of the software.
      • getOs

        public java.lang.String getOs()
        Returns the operating system of the queried entity. This property will always be present in a result.
        Returns:
        the operating system of the queried entity.
      • setOs

        public void setOs​(java.lang.String os)
        Sets the operating system of the queried entity. This message should only be invoked when parsing the XML and setting the property to a Version instance.
        Parameters:
        os - operating system of the queried entity.
      • getIQChildElementBuilder

        protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder​(IQ.IQChildElementXmlStringBuilder xml)
        Description copied from class: IQ
        This method must be overwritten by IQ subclasses to create their child content. It is important you don't use the builder to add the final end tag. This will be done automatically by IQ.IQChildElementXmlStringBuilder after eventual existing ExtensionElements have been added.

        For example to create an IQ with a extra attribute and an additional child element

         
         <iq to='foo@example.org' id='123'>
           <bar xmlns='example:bar' extraAttribute='blaz'>
              <extraElement>elementText</extraElement>
           </bar>
         </iq>
         
         
        the body of the getIQChildElementBuilder looks like
         
         // The builder 'xml' will already have the child element and the 'xmlns' attribute added
         // So the current builder state is "<bar xmlns='example:bar'"
         xml.attribute("extraAttribute", "blaz");
         xml.rightAngleBracket();
         xml.element("extraElement", "elementText");
         // Do not close the 'bar' attribute by calling xml.closeElement('bar')
         
         
        If your IQ only contains attributes and no child elements, i.e. it can be represented as empty element, then you can mark it as such.
         xml.attribute("myAttribute", "myAttributeValue");
         xml.setEmptyElement();
         
        If your IQ does not contain any attributes or child elements (besides ExtensionElements), consider sub-classing SimpleIQ instead.
        Specified by:
        getIQChildElementBuilder in class IQ
        Parameters:
        xml - a pre-created builder which already has the child element and the 'xmlns' attribute set.
        Returns:
        the build to create the IQ child content.