Class LocalAndDomainpartJid

java.lang.Object
org.jxmpp.jid.impl.AbstractJid
org.jxmpp.jid.impl.LocalAndDomainpartJid
All Implemented Interfaces:
Serializable, CharSequence, Comparable<Jid>, BareJid, EntityBareJid, EntityJid, Jid

public final class LocalAndDomainpartJid extends AbstractJid implements EntityBareJid
See Also:
  • Method Details

    • getLocalpart

      public Localpart getLocalpart()
      Description copied from interface: EntityJid
      Return the Localpart of this JID.
      Specified by:
      getLocalpart in interface EntityJid
      Returns:
      the localpart.
    • toString

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

      public 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 [email protected]', the escaped real JID created with JidCreate will be 'at\26t\[email protected]', which is what Jid.toString() will return. But Jid.asUnescapedString() will return again 'at&t [email protected]'.
      Specified by:
      asUnescapedString in interface Jid
      Returns:
      the unescaped String representation of this JID.
    • asEntityBareJidIfPossible

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

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

      public DomainFullJid asDomainFullJidIfPossible()
      Description copied from interface: Jid
      Convert this Jid to a DomainFullJid if possible.
      Specified by:
      asDomainFullJidIfPossible in interface Jid
      Returns:
      the corresponding DomainFullJid or null.
    • 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.
    • 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.
    • getDomain

      public Domainpart getDomain()
      Description copied from interface: Jid
      Get the Domainpart of this Jid.
      Specified by:
      getDomain in interface Jid
      Returns:
      the domainpart.
    • 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.
    • hasNoResource

      public boolean hasNoResource()
      Description copied from interface: Jid
      Check if this is an instance of EntityBareJid or DomainBareJid.
      Specified by:
      hasNoResource in interface Jid
      Specified by:
      hasNoResource in class AbstractJid
      Returns:
      true if this is an instance of BareJid or DomainBareJid
    • asEntityJidIfPossible

      public EntityJid asEntityJidIfPossible()
      Description copied from interface: Jid
      Convert this Jid to a EntityJid if possible.
      Specified by:
      asEntityJidIfPossible in interface Jid
      Returns:
      the corresponding EntityJid or null.
    • 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.
    • asEntityBareJid

      public EntityBareJid asEntityBareJid()
      Description copied from interface: EntityJid
      Return the bare JID of this entity JID.
      Specified by:
      asEntityBareJid in interface EntityJid
      Returns:
      the bare JID.
    • getResourceOrNull

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

      If the JID is of form <[email protected]/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 <[email protected]> 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.
    • asEntityBareJidString

      public String asEntityBareJidString()
      Description copied from interface: EntityJid
      Return the bare JID string of this full JID.
      Specified by:
      asEntityBareJidString in interface EntityJid
      Returns:
      the bare JID string.