Class DomainpartJid

    • Method Detail

      • getDomain

        public Domainpart getDomain()
        Description copied from interface: Jid
        Get the Domainpart of this Jid.
        Specified by:
        getDomain in interface Jid
        Returns:
        the domainpart.
      • toString

        public java.lang.String toString()
        Description copied from interface: Jid
        Returns the String representation of this JID.
        Specified by:
        toString in interface java.lang.CharSequence
        Specified by:
        toString in interface Jid
        Overrides:
        toString in class java.lang.Object
        Returns:
        the String representation of this JID.
      • asUnescapedString

        public java.lang.String asUnescapedString()
        Description copied from interface: Jid
        Return the unescaped String representation of this JID.

        Since certain Unicode code points are disallowed in the localpart of a JID by the required stringprep profile, those need to get escaped when used in a real JID. The unescaped representation of the JID is only for presentation to a human user or for gatewaying to a non-XMPP system.

        For example, if the users inputs 'at&t guy@example.com', the escaped real JID created with JidCreate will be 'at\26t\20guy@example.com', which is what Jid.toString() will return. But Jid.asUnescapedString() will return again 'at&t guy@example.com'.
        Specified by:
        asUnescapedString in interface Jid
        Returns:
        the unescaped String representation of this JID.
      • asDomainBareJid

        public DomainBareJid asDomainBareJid()
        Description copied from interface: Jid
        Convert this Jid to a DomainBareJid.

        Note that it is always possible to convert a Jid to a DomainBareJid, since every Jid has a domain part.

        Specified by:
        asDomainBareJid in interface Jid
        Returns:
        the corresponding DomainBareJid.
      • isParentOf

        public boolean isParentOf​(EntityBareJid bareJid)
        Description copied from interface: Jid
        Specified by:
        isParentOf in interface Jid
        Parameters:
        bareJid - the bare JID.
        Returns:
        true if this JID is a parent of the given JID.
      • isParentOf

        public boolean isParentOf​(EntityFullJid fullJid)
        Description copied from interface: Jid
        Specified by:
        isParentOf in interface Jid
        Parameters:
        fullJid - the full JID.
        Returns:
        true if this JID is a parent of the given JID.
      • isParentOf

        public boolean isParentOf​(DomainBareJid domainBareJid)
        Description copied from interface: Jid
        Specified by:
        isParentOf in interface Jid
        Parameters:
        domainBareJid - the domain bare JID.
        Returns:
        true if this JID is a parent of the given JID.
      • isParentOf

        public boolean isParentOf​(DomainFullJid domainFullJid)
        Description copied from interface: Jid
        Specified by:
        isParentOf in interface Jid
        Parameters:
        domainFullJid - the domain full JID.
        Returns:
        true if this JID is a parent of the given JID.
      • asBareJid

        public BareJid asBareJid()
        Description copied from interface: Jid
        Return a JID created by removing the Resourcepart from this JID.
        Specified by:
        asBareJid in interface Jid
        Returns:
        this Jid without a Resourcepart.
      • asFullJidIfPossible

        public FullJid asFullJidIfPossible()
        Description copied from interface: Jid
        Convert this Jid to a FullJid if possible.
        Specified by:
        asFullJidIfPossible in interface Jid
        Returns:
        the corresponding FullJid or null.
      • getResourceOrNull

        public Resourcepart getResourceOrNull()
        Description copied from interface: Jid
        Get the resourcepart of this JID or null.

        If the JID is of form <localpart@domain.example/resource> then this method returns 'resource'. If the JID no resourcepart, then null is returned.

        Specified by:
        getResourceOrNull in interface Jid
        Specified by:
        getResourceOrNull in class AbstractJid
        Returns:
        the resource of this JID or null.
      • getLocalpartOrNull

        public Localpart getLocalpartOrNull()
        Description copied from interface: Jid
        Get the localpart of this JID or null.

        If the JID is of form <localpart@domain.example> then this method returns 'localpart'. If the JID has no localpart, then null is returned.

        Specified by:
        getLocalpartOrNull in interface Jid
        Specified by:
        getLocalpartOrNull in class AbstractJid
        Returns:
        the localpart of this JID or null.