public final class DomainAndResourcepartJid extends AbstractJid implements DomainFullJid
Note that this implementation does not require an cache for the unescaped
string, compared to LocalDomainAndResourcepartJid.
| Modifier and Type | Method and Description |
|---|---|
BareJid |
asBareJidIfPossible()
Convert this Jid to a BareJid if possible.
|
DomainBareJid |
asDomainBareJid()
Convert this Jid to a
DomainBareJid. |
DomainFullJid |
asDomainFullJidIfPossible()
Convert this Jid to a
DomainFullJid if possible. |
FullJid |
asFullJidIfPossible()
Convert this Jid to a FullJid if possible.
|
JidWithLocalpart |
asJidWithLocalpartIfPossible()
Convert this Jid to a
JidWithLocalpart if possible. |
JidWithResource |
asJidWithResourcepartIfPossible()
Convert this Jid to a
JidWithResource if possible. |
java.lang.String |
asUnescapedString()
Return the unescaped String representation of this JID.
|
Domainpart |
getDomain()
Get the
Domainpart of this Jid. |
Localpart |
getLocalpartOrNull()
Get the localpart of this JID or null.
|
Resourcepart |
getResourceOrNull()
Get the resourcepart of this JID or null.
|
Resourcepart |
getResourcepart()
Return the
Resourcepart of this JID. |
boolean |
hasNoResource()
Check if this is an instance of
BareJid or DomainBareJid. |
boolean |
isParentOf(BareJid bareJid)
See
Jid.isParentOf(Jid). |
boolean |
isParentOf(DomainBareJid domainBareJid)
See
Jid.isParentOf(Jid). |
boolean |
isParentOf(DomainFullJid domainFullJid)
See
Jid.isParentOf(Jid). |
boolean |
isParentOf(FullJid fullJid)
See
Jid.isParentOf(Jid). |
java.lang.String |
toString()
Returns the String representation of this JID.
|
Jid |
withoutResource()
Return a JID created by removing the Resourcepart from this JID.
|
charAt, compareTo, downcast, equals, equals, equals, hashCode, hasLocalpart, hasResource, isBareJid, isBareOrFullJid, isDomainBareJid, isDomainFullJid, isFullJid, isParentOf, length, subSequenceclone, finalize, getClass, notify, notifyAll, wait, wait, waitdowncast, equals, equals, hasLocalpart, hasResource, isBareJid, isBareOrFullJid, isDomainBareJid, isDomainFullJid, isFullJid, isParentOfpublic java.lang.String toString()
Jidpublic DomainBareJid asDomainBareJid()
JidDomainBareJid.
Note that it is always possible to convert a Jid to a DomainBareJid, since every Jid has a domain part.
asDomainBareJid in interface Jidpublic final boolean hasNoResource()
JidBareJid or DomainBareJid.hasNoResource in interface JidhasNoResource in class AbstractJidpublic BareJid asBareJidIfPossible()
JidasBareJidIfPossible in interface Jidpublic FullJid asFullJidIfPossible()
JidasFullJidIfPossible in interface Jidpublic DomainFullJid asDomainFullJidIfPossible()
JidDomainFullJid if possible.asDomainFullJidIfPossible in interface Jidpublic Resourcepart getResourceOrNull()
Jid
If the JID is of form <localpart@domain.example/resource> then this method returns 'resource'. If the JID no
resourcepart, then null is returned.
getResourceOrNull in interface JidgetResourceOrNull in class AbstractJidpublic boolean isParentOf(BareJid bareJid)
JidJid.isParentOf(Jid).isParentOf in interface JidbareJid - the bare JID.public boolean isParentOf(FullJid fullJid)
JidJid.isParentOf(Jid).isParentOf in interface JidfullJid - the full JID.public boolean isParentOf(DomainBareJid domainBareJid)
JidJid.isParentOf(Jid).isParentOf in interface JiddomainBareJid - the domain bare JID.public boolean isParentOf(DomainFullJid domainFullJid)
JidJid.isParentOf(Jid).isParentOf in interface JiddomainFullJid - the domain full JID.public Resourcepart getResourcepart()
JidWithResourceResourcepart of this JID.getResourcepart in interface JidWithResourcepublic Jid withoutResource()
JidwithoutResource in interface Jidpublic Domainpart getDomain()
JidDomainpart of this Jid.public java.lang.String asUnescapedString()
JidSince 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'.asUnescapedString in interface Jidpublic JidWithLocalpart asJidWithLocalpartIfPossible()
JidJidWithLocalpart if possible.asJidWithLocalpartIfPossible in interface Jidpublic JidWithResource asJidWithResourcepartIfPossible()
JidJidWithResource if possible.asJidWithResourcepartIfPossible in interface Jidpublic Localpart getLocalpartOrNull()
Jid
If the JID is of form <localpart@domain.example> then this method returns 'localpart'. If the JID has no
localpart, then null is returned.
getLocalpartOrNull in interface JidgetLocalpartOrNull in class AbstractJid