Class MalformedJid

    • Method Detail

      • asBareJid

        public final Jid asBareJid()
        Description copied from interface: Jid
        Gets the bare JID representation of this JID, i.e. removes the resource part.

        The term "bare JID" refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server).

        Returns:
        The bare JID.
        See Also:
        Jid.withResource(CharSequence)
      • withLocal

        public Jid withLocal​(CharSequence local)
        Description copied from interface: Jid
        Creates a new JID with a new local part and the same domain and resource part of the current JID.
        Parameters:
        local - The local part.
        Returns:
        The JID with a new local part.
        See Also:
        Jid.withResource(CharSequence)
      • withResource

        public Jid withResource​(CharSequence resource)
        Description copied from interface: Jid
        Creates a new full JID with a resource and the same local and domain part of the current JID.
        Parameters:
        resource - The resource.
        Returns:
        The full JID with a resource.
        See Also:
        Jid.asBareJid(), Jid.withLocal(CharSequence)
      • atSubdomain

        public Jid atSubdomain​(CharSequence subdomain)
        Description copied from interface: Jid
        Creates a new JID at a subdomain and at the same domain as this JID.
        Parameters:
        subdomain - The subdomain.
        Returns:
        The JID at a subdomain.
      • getLocal

        public final String getLocal()
        Description copied from interface: Jid
        Gets the local part of the JID, also known as the name or node.

        3.3. Localpart

        The localpart of a JID is an optional identifier placed before the domainpart and separated from the latter by the '@' character. Typically, a localpart uniquely identifies the entity requesting and using network access provided by a server (i.e., a local account), although it can also represent other kinds of entities (e.g., a chatroom associated with a multi-user chat service [XEP-0045]). The entity represented by an XMPP localpart is addressed within the context of a specific domain (i.e., <localpart@domainpart>).

        Returns:
        The local part or null.
        See Also:
        Jid.getEscapedLocal()
      • getEscapedLocal

        public final String getEscapedLocal()
        Description copied from interface: Jid
        Gets the escaped local part of the JID.
        Returns:
        The escaped local part or null.
        See Also:
        Jid.getLocal()
      • getDomain

        public final String getDomain()
        Description copied from interface: Jid
        Gets the domain part.

        3.2. Domainpart

        The domainpart is the primary identifier and is the only REQUIRED element of a JID (a mere domainpart is a valid JID). Typically, a domainpart identifies the "home" server to which clients connect for XML routing and data management functionality.

        Returns:
        The domain part.
      • getResource

        public final String getResource()
        Description copied from interface: Jid
        Gets the resource part.

        3.4. Resourcepart

        The resourcepart of a JID is an optional identifier placed after the domainpart and separated from the latter by the '/' character. A resourcepart can modify either a <localpart@domainpart> address or a mere <domainpart> address. Typically, a resourcepart uniquely identifies a specific connection (e.g., a device or location) or object (e.g., an occupant in a multi-user chatroom [XEP-0045]) belonging to the entity associated with an XMPP localpart at a domain (i.e., <localpart@domainpart/resourcepart>).

        Returns:
        The resource part or null.
      • getCause

        public final Throwable getCause()
        Gets the cause why the JID is malformed.
        Returns:
        The cause.
      • isFullJid

        public final boolean isFullJid()
        Checks if the JID is a full JID.

        The term "full JID" refers to an XMPP address of the form <localpart@domainpart/resourcepart> (for a particular authorized client or device associated with an account) or of the form <domainpart/resourcepart> (for a particular resource or script associated with a server).

        Specified by:
        isFullJid in interface Jid
        Returns:
        True, if the JID is a full JID; otherwise false.
      • isBareJid

        public final boolean isBareJid()
        Checks if the JID is a bare JID.

        The term "bare JID" refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server).

        Specified by:
        isBareJid in interface Jid
        Returns:
        True, if the JID is a bare JID; otherwise false.
      • isDomainJid

        public final boolean isDomainJid()
        Description copied from interface: Jid
        Checks if the JID is a domain JID, i.e. if it has no local part.
        Specified by:
        isDomainJid in interface Jid
        Returns:
        True, if the JID is a domain JID, i.e. if it has no local part.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • compareTo

        public final int compareTo​(Jid o)
        Compares this JID with another JID. First domain parts are compared. If these are equal, local parts are compared and if these are equal, too, resource parts are compared.
        Specified by:
        compareTo in interface Comparable<Jid>
        Parameters:
        o - The other JID.
        Returns:
        The comparison result.
      • charAt

        public final char charAt​(int index)
        Specified by:
        charAt in interface CharSequence