Package org.jxmpp.jid.impl
Class DomainpartJid
- java.lang.Object
-
- org.jxmpp.jid.impl.AbstractJid
-
- org.jxmpp.jid.impl.DomainpartJid
-
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<Jid>
,BareJid
,DomainBareJid
,DomainJid
,Jid
public final class DomainpartJid extends AbstractJid implements DomainBareJid
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Domainpart
domain
-
Fields inherited from class org.jxmpp.jid.impl.AbstractJid
cache
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BareJid
asBareJid()
Return a JID created by removing the Resourcepart from this JID.DomainBareJid
asDomainBareJid()
Convert this Jid to aDomainBareJid
.DomainFullJid
asDomainFullJidIfPossible()
Convert this Jid to aDomainFullJid
if possible.EntityBareJid
asEntityBareJidIfPossible()
Convert this Jid to aEntityBareJid
if possible.EntityFullJid
asEntityFullJidIfPossible()
Convert this Jid to aEntityFullJid
if possible.EntityJid
asEntityJidIfPossible()
Convert this Jid to aEntityJid
if possible.FullJid
asFullJidIfPossible()
Convert this Jid to aFullJid
if possible.String
asUnescapedString()
Return the unescaped String representation of this JID.Domainpart
getDomain()
Get theDomainpart
of this Jid.Localpart
getLocalpartOrNull()
Get the localpart of this JID or null.Resourcepart
getResourceOrNull()
Get the resourcepart of this JID or null.boolean
hasNoResource()
Check if this is an instance ofEntityBareJid
orDomainBareJid
.boolean
isParentOf(DomainBareJid domainBareJid)
SeeJid.isParentOf(Jid)
.boolean
isParentOf(DomainFullJid domainFullJid)
SeeJid.isParentOf(Jid)
.boolean
isParentOf(EntityBareJid bareJid)
SeeJid.isParentOf(Jid)
.boolean
isParentOf(EntityFullJid fullJid)
SeeJid.isParentOf(Jid)
.String
toString()
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
-
-
-
-
Field Detail
-
domain
protected final Domainpart domain
-
-
Method Detail
-
getDomain
public Domainpart getDomain()
Description copied from interface:Jid
Get theDomainpart
of this Jid.
-
toString
public String toString()
Description copied from interface:Jid
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 guy@example.com'
, the escaped real JID created withJidCreate
will be'at\26t\20guy@example.com'
, which is whatJid.toString()
will return. ButJid.asUnescapedString()
will return again'at&t guy@example.com'
.- Specified by:
asUnescapedString
in interfaceJid
- Returns:
- the unescaped String representation of this JID.
-
asDomainBareJid
public DomainBareJid asDomainBareJid()
Description copied from interface:Jid
Convert 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:
asDomainBareJid
in interfaceJid
- Returns:
- the corresponding DomainBareJid.
-
hasNoResource
public boolean hasNoResource()
Description copied from interface:Jid
Check if this is an instance ofEntityBareJid
orDomainBareJid
.- Specified by:
hasNoResource
in interfaceJid
- Specified by:
hasNoResource
in classAbstractJid
- Returns:
- true if this is an instance of BareJid or DomainBareJid
-
asEntityBareJidIfPossible
public EntityBareJid asEntityBareJidIfPossible()
Description copied from interface:Jid
Convert this Jid to aEntityBareJid
if possible.- Specified by:
asEntityBareJidIfPossible
in interfaceJid
- Returns:
- the corresponding
EntityBareJid
or null.
-
asEntityFullJidIfPossible
public EntityFullJid asEntityFullJidIfPossible()
Description copied from interface:Jid
Convert this Jid to aEntityFullJid
if possible.- Specified by:
asEntityFullJidIfPossible
in interfaceJid
- Returns:
- the corresponding
EntityFullJid
or null.
-
asDomainFullJidIfPossible
public DomainFullJid asDomainFullJidIfPossible()
Description copied from interface:Jid
Convert this Jid to aDomainFullJid
if possible.- Specified by:
asDomainFullJidIfPossible
in interfaceJid
- Returns:
- the corresponding DomainFullJid or null.
-
isParentOf
public boolean isParentOf(EntityBareJid bareJid)
Description copied from interface:Jid
SeeJid.isParentOf(Jid)
.- Specified by:
isParentOf
in 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:Jid
SeeJid.isParentOf(Jid)
.- Specified by:
isParentOf
in 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:Jid
SeeJid.isParentOf(Jid)
.- Specified by:
isParentOf
in 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:Jid
SeeJid.isParentOf(Jid)
.- Specified by:
isParentOf
in interfaceJid
- 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.
-
asEntityJidIfPossible
public EntityJid asEntityJidIfPossible()
Description copied from interface:Jid
Convert this Jid to aEntityJid
if possible.- Specified by:
asEntityJidIfPossible
in interfaceJid
- Returns:
- the corresponding
EntityJid
or null.
-
asFullJidIfPossible
public FullJid asFullJidIfPossible()
Description copied from interface:Jid
Convert this Jid to aFullJid
if possible.- Specified by:
asFullJidIfPossible
in interfaceJid
- 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, thennull
is returned.- Specified by:
getResourceOrNull
in interfaceJid
- Specified by:
getResourceOrNull
in classAbstractJid
- 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, thennull
is returned.- Specified by:
getLocalpartOrNull
in interfaceJid
- Specified by:
getLocalpartOrNull
in classAbstractJid
- Returns:
- the localpart of this JID or null.
-
-