Class TimeBuilder

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.IqView, org.jivesoftware.smack.packet.StanzaView, org.jivesoftware.smack.packet.XmlLangElement, TimeView

    public class TimeBuilder
    extends org.jivesoftware.smack.packet.IqBuilder<TimeBuilder,​Time>
    implements TimeView
    • Field Summary

      • Fields inherited from class org.jivesoftware.smack.packet.AbstractIqBuilder

        type
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Time build()  
      TimeBuilder getThis()  
      java.lang.String getTzo()
      Returns the time zone.
      java.lang.String getUtc()
      Returns the time as a UTC formatted String using the format CCYY-MM-DDThh:mm:ssZ.
      TimeBuilder setTime​(java.util.Calendar calendar)  
      TimeBuilder setUtcAndTzo​(java.lang.String utc, java.lang.String tzo)
      Sets the time using UTC formatted String, in the format CCYY-MM-DDThh:mm:ssZ, and the provided timezone definition in the format (+|-)hh:mm.
      • Methods inherited from class org.jivesoftware.smack.packet.IqBuilder

        ofType
      • Methods inherited from class org.jivesoftware.smack.packet.AbstractIqBuilder

        addStanzaSpecificAttributes, createErrorResponse, createResponse, createResponse, getType
      • Methods inherited from class org.jivesoftware.smack.packet.StanzaBuilder

        addExtension, addExtensions, addOptExtensions, buildIqData, buildMessage, buildMessage, buildMessageFrom, buildMessageFrom, buildPresence, buildPresence, buildPresenceFrom, buildPresenceFrom, buildResponse, from, from, getError, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getLanguage, getStanzaId, getTo, overrideExtension, removeExtension, removeExtension, setError, setLanguage, throwIfNoStanzaId, to, to, toString, willBuildStanzaWithId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.IqView

        getType
      • Methods inherited from interface org.jivesoftware.smack.packet.StanzaView

        getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension
      • Methods inherited from interface org.jivesoftware.smack.packet.XmlLangElement

        getLanguage
    • Method Detail

      • setUtcAndTzo

        public TimeBuilder setUtcAndTzo​(java.lang.String utc,
                                        java.lang.String tzo)
                                 throws java.text.ParseException
        Sets the time using UTC formatted String, in the format CCYY-MM-DDThh:mm:ssZ, and the provided timezone definition in the format (+|-)hh:mm.
        Parameters:
        utc - the time using a formatted String.
        tzo - the time zone definition.
        Returns:
        a reference to this builder.
        Throws:
        java.text.ParseException - if the provided string is not parsable (e.g. because it does not follow the expected format).
      • setTime

        public TimeBuilder setTime​(java.util.Calendar calendar)
      • getUtc

        public java.lang.String getUtc()
        Description copied from interface: TimeView
        Returns the time as a UTC formatted String using the format CCYY-MM-DDThh:mm:ssZ.
        Specified by:
        getUtc in interface TimeView
        Returns:
        the time as a UTC formatted String.
      • getTzo

        public java.lang.String getTzo()
        Description copied from interface: TimeView
        Returns the time zone.
        Specified by:
        getTzo in interface TimeView
        Returns:
        the time zone.
      • build

        public Time build()
        Specified by:
        build in class org.jivesoftware.smack.packet.IqBuilder<TimeBuilder,​Time>
      • getThis

        public TimeBuilder getThis()
        Specified by:
        getThis in class org.jivesoftware.smack.packet.StanzaBuilder<TimeBuilder>