Package org.jxmpp.jid.impl
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jxmpp.jid.impl.AbstractJid
cache
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BareJidasBareJid()Return a JID created by removing the Resourcepart from this JID.DomainBareJidasDomainBareJid()Convert this Jid to aDomainBareJid.DomainFullJidasDomainFullJidIfPossible()Convert this Jid to aDomainFullJidif possible.EntityBareJidasEntityBareJid()Return the bare JID of this entity JID.EntityBareJidasEntityBareJidIfPossible()Convert this Jid to aEntityBareJidif possible.StringasEntityBareJidString()Return the bare JID string of this full JID.EntityFullJidasEntityFullJidIfPossible()Convert this Jid to aEntityFullJidif possible.EntityJidasEntityJidIfPossible()Convert this Jid to aEntityJidif possible.FullJidasFullJidIfPossible()Convert this Jid to aFullJidif possible.StringasUnescapedString()Return the unescaped String representation of this JID.DomainpartgetDomain()Get theDomainpartof this Jid.LocalpartgetLocalpart()Return theLocalpartof this JID.LocalpartgetLocalpartOrNull()Get the localpart of this JID or null.ResourcepartgetResourceOrNull()Get the resourcepart of this JID or null.booleanhasNoResource()Check if this is an instance ofEntityBareJidorDomainBareJid.booleanisParentOf(DomainBareJid domainBareJid)SeeJid.isParentOf(Jid).booleanisParentOf(DomainFullJid domainFullJid)SeeJid.isParentOf(Jid).booleanisParentOf(EntityBareJid bareJid)SeeJid.isParentOf(Jid).booleanisParentOf(EntityFullJid fullJid)SeeJid.isParentOf(Jid).StringtoString()Returns the String representation of this JID.-
Methods inherited from class org.jxmpp.jid.impl.AbstractJid
asDomainFullJidOrThrow, asEntityBareJidOrThrow, asEntityFullJidOrThrow, asEntityJidOrThrow, asFullJidOrThrow, asUrlEncodedString, charAt, compareTo, downcast, equals, equals, equals, getLocalpartOrThrow, getResourceOrEmpty, getResourceOrThrow, hashCode, hasLocalpart, hasResource, intern, isDomainBareJid, isDomainFullJid, isEntityBareJid, isEntityFullJid, isEntityJid, isParentOf, length, subSequence
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, length, subSequence
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.jxmpp.jid.Jid
asDomainFullJidOrThrow, asEntityBareJidOrThrow, asEntityFullJidOrThrow, asEntityJidOrThrow, asFullJidOrThrow, asUrlEncodedString, downcast, equals, equals, getLocalpartOrThrow, getResourceOrEmpty, getResourceOrThrow, hasLocalpart, hasResource, intern, isDomainBareJid, isDomainFullJid, isEntityBareJid, isEntityFullJid, isEntityJid, isParentOf
-
-
-
-
Method Detail
-
getLocalpart
public Localpart getLocalpart()
Description copied from interface:EntityJidReturn theLocalpartof this JID.- Specified by:
getLocalpartin interfaceEntityJid- Returns:
- the localpart.
-
toString
public String toString()
Description copied from interface:JidReturns the String representation of this JID.
-
asUnescapedString
public String asUnescapedString()
Description copied from interface:JidReturn 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 withJidCreatewill be'at\26t\20guy@example.com', which is whatJid.toString()will return. ButJid.asUnescapedString()will return again'at&t guy@example.com'.- Specified by:
asUnescapedStringin interfaceJid- Returns:
- the unescaped String representation of this JID.
-
asEntityBareJidIfPossible
public EntityBareJid asEntityBareJidIfPossible()
Description copied from interface:JidConvert this Jid to aEntityBareJidif possible.- Specified by:
asEntityBareJidIfPossiblein interfaceJid- Returns:
- the corresponding
EntityBareJidor null.
-
asEntityFullJidIfPossible
public EntityFullJid asEntityFullJidIfPossible()
Description copied from interface:JidConvert this Jid to aEntityFullJidif possible.- Specified by:
asEntityFullJidIfPossiblein interfaceJid- Returns:
- the corresponding
EntityFullJidor null.
-
asDomainFullJidIfPossible
public DomainFullJid asDomainFullJidIfPossible()
Description copied from interface:JidConvert this Jid to aDomainFullJidif possible.- Specified by:
asDomainFullJidIfPossiblein interfaceJid- Returns:
- the corresponding DomainFullJid or null.
-
isParentOf
public boolean isParentOf(EntityBareJid bareJid)
Description copied from interface:JidSeeJid.isParentOf(Jid).- Specified by:
isParentOfin interfaceJid- 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:JidSeeJid.isParentOf(Jid).- Specified by:
isParentOfin interfaceJid- 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:JidSeeJid.isParentOf(Jid).- Specified by:
isParentOfin interfaceJid- 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:JidSeeJid.isParentOf(Jid).- Specified by:
isParentOfin interfaceJid- 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:JidConvert this Jid to aDomainBareJid.Note that it is always possible to convert a Jid to a DomainBareJid, since every Jid has a domain part.
- Specified by:
asDomainBareJidin interfaceJid- Returns:
- the corresponding DomainBareJid.
-
getDomain
public Domainpart getDomain()
Description copied from interface:JidGet theDomainpartof this Jid.
-
asBareJid
public BareJid asBareJid()
Description copied from interface:JidReturn a JID created by removing the Resourcepart from this JID.
-
hasNoResource
public boolean hasNoResource()
Description copied from interface:JidCheck if this is an instance ofEntityBareJidorDomainBareJid.- Specified by:
hasNoResourcein interfaceJid- Specified by:
hasNoResourcein classAbstractJid- Returns:
- true if this is an instance of BareJid or DomainBareJid
-
asEntityJidIfPossible
public EntityJid asEntityJidIfPossible()
Description copied from interface:JidConvert this Jid to aEntityJidif possible.- Specified by:
asEntityJidIfPossiblein interfaceJid- Returns:
- the corresponding
EntityJidor null.
-
asFullJidIfPossible
public FullJid asFullJidIfPossible()
Description copied from interface:JidConvert this Jid to aFullJidif possible.- Specified by:
asFullJidIfPossiblein interfaceJid- Returns:
- the corresponding
FullJidor null.
-
asEntityBareJid
public EntityBareJid asEntityBareJid()
Description copied from interface:EntityJidReturn the bare JID of this entity JID.- Specified by:
asEntityBareJidin interfaceEntityJid- Returns:
- the bare JID.
-
getResourceOrNull
public Resourcepart getResourceOrNull()
Description copied from interface:JidGet 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, thennullis returned.- Specified by:
getResourceOrNullin interfaceJid- Specified by:
getResourceOrNullin classAbstractJid- Returns:
- the resource of this JID or null.
-
getLocalpartOrNull
public Localpart getLocalpartOrNull()
Description copied from interface:JidGet 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, thennullis returned.- Specified by:
getLocalpartOrNullin interfaceJid- Specified by:
getLocalpartOrNullin classAbstractJid- Returns:
- the localpart of this JID or null.
-
asEntityBareJidString
public String asEntityBareJidString()
Description copied from interface:EntityJidReturn the bare JID string of this full JID.- Specified by:
asEntityBareJidStringin interfaceEntityJid- Returns:
- the bare JID string.
-
-