Class AbstractJid
- java.lang.Object
- 
- org.jxmpp.jid.impl.AbstractJid
 
- 
- All Implemented Interfaces:
- Serializable,- CharSequence,- Comparable<Jid>,- Jid
 - Direct Known Subclasses:
- DomainAndResourcepartJid,- DomainpartJid,- LocalAndDomainpartJid,- LocalDomainAndResourcepartJid
 
 public abstract class AbstractJid extends Object implements Jid - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description AbstractJid()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DomainFullJidasDomainFullJidOrThrow()Convert this Jid to aDomainFullJidor throw anIllegalStateExceptionif this is not possible.EntityBareJidasEntityBareJidOrThrow()Convert this Jid to aEntityBareJidor throw anIllegalStateExceptionif this is not possible.EntityFullJidasEntityFullJidOrThrow()Convert this Jid to aEntityFullJidor throw anIllegalStateExceptionif this is not possible.EntityJidasEntityJidOrThrow()Convert this Jid to aEntityJidor throw anIllegalStateExceptionif this is not possible.EntityFullJidasFullJidOrThrow()Convert this Jid to aFullJidor throw anIllegalStateExceptionif this is not possible.StringasUrlEncodedString()Get the URL encoded version of this JID.charcharAt(int index)intcompareTo(Jid other)<T extends Jid>
 Tdowncast(Class<T> jidClass)Return the downcasted instance of this Jid.booleanequals(CharSequence charSequence)Compares the given CharSequence with this JID.booleanequals(Object other)booleanequals(String string)Compares the given String wit this JID.abstract LocalpartgetLocalpartOrNull()Get the localpart of this JID or null.LocalpartgetLocalpartOrThrow()Get the localpart of this JID or throw anIllegalStateException.ResourcepartgetResourceOrEmpty()Get the resourcepart of this JID or return the empty resourcepart.abstract ResourcepartgetResourceOrNull()Get the resourcepart of this JID or null.ResourcepartgetResourceOrThrow()Get the resourcepart of this JID or throw anIllegalStateException.inthashCode()booleanhasLocalpart()Check if this is a Jid with aLocalpart.abstract booleanhasNoResource()Check if this is an instance ofEntityBareJidorDomainBareJid.booleanhasResource()Check if this is a Jid with aResourcepart.Stringintern()Returns the canonical String representation of this JID.booleanisDomainBareJid()Check if this is an instance ofDomainBareJid.booleanisDomainFullJid()Check if this is an instance ofDomainFullJid.booleanisEntityBareJid()Check if this is an instance ofEntityBareJid.booleanisEntityFullJid()Check if this is an instance ofEntityFullJid.booleanisEntityJid()Check if this is aEntityBareJidorEntityFullJid.booleanisParentOf(Jid jid)Check if this JID is the parent of another JID.intlength()CharSequencesubSequence(int start, int end)- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.CharSequencechars, codePoints
 - 
Methods inherited from interface org.jxmpp.jid.JidasBareJid, asDomainBareJid, asDomainFullJidIfPossible, asEntityBareJidIfPossible, asEntityFullJidIfPossible, asEntityJidIfPossible, asFullJidIfPossible, asUnescapedString, getDomain, isParentOf, isParentOf, isParentOf, isParentOf, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractJidpublic AbstractJid() 
 
- 
 - 
Method Detail- 
isEntityJidpublic final boolean isEntityJid() Description copied from interface:JidCheck if this is aEntityBareJidorEntityFullJid.- Specified by:
- isEntityJidin interface- Jid
- Returns:
- true if this is an instance of BareJid or FullJid.
 
 - 
isEntityBareJidpublic final boolean isEntityBareJid() Description copied from interface:JidCheck if this is an instance ofEntityBareJid.- Specified by:
- isEntityBareJidin interface- Jid
- Returns:
- true if this is an instance of EntityBareJid
 
 - 
isEntityFullJidpublic final boolean isEntityFullJid() Description copied from interface:JidCheck if this is an instance ofEntityFullJid.- Specified by:
- isEntityFullJidin interface- Jid
- Returns:
- true if this is an instance of EntityFullJid
 
 - 
isDomainBareJidpublic final boolean isDomainBareJid() Description copied from interface:JidCheck if this is an instance ofDomainBareJid.- Specified by:
- isDomainBareJidin interface- Jid
- Returns:
- true if this is an instance of DomainBareJid
 
 - 
isDomainFullJidpublic final boolean isDomainFullJid() Description copied from interface:JidCheck if this is an instance ofDomainFullJid.- Specified by:
- isDomainFullJidin interface- Jid
- Returns:
- true if this is an instance of DomainFullJid
 
 - 
hasNoResourcepublic abstract boolean hasNoResource() Description copied from interface:JidCheck if this is an instance ofEntityBareJidorDomainBareJid.- Specified by:
- hasNoResourcein interface- Jid
- Returns:
- true if this is an instance of BareJid or DomainBareJid
 
 - 
hasResourcepublic final boolean hasResource() Description copied from interface:JidCheck if this is a Jid with aResourcepart.- Specified by:
- hasResourcein interface- Jid
- Returns:
- true if this Jid has a resourcepart.
 
 - 
hasLocalpartpublic final boolean hasLocalpart() Description copied from interface:JidCheck if this is a Jid with aLocalpart.- Specified by:
- hasLocalpartin interface- Jid
- Returns:
- true if this Jid has a localpart.
 
 - 
downcastpublic final <T extends Jid> T downcast(Class<T> jidClass) Description copied from interface:JidReturn the downcasted instance of this Jid. This method is unsafe, make sure to check that this is actually of the type of are casting to.
 - 
lengthpublic int length() - Specified by:
- lengthin interface- CharSequence
 
 - 
charAtpublic char charAt(int index) - Specified by:
- charAtin interface- CharSequence
 
 - 
subSequencepublic CharSequence subSequence(int start, int end) - Specified by:
- subSequencein interface- CharSequence
 
 - 
asEntityBareJidOrThrowpublic final EntityBareJid asEntityBareJidOrThrow() Description copied from interface:JidConvert this Jid to aEntityBareJidor throw anIllegalStateExceptionif this is not possible.- Specified by:
- asEntityBareJidOrThrowin interface- Jid
- Returns:
- the corresponding EntityBareJid.
 
 - 
asEntityFullJidOrThrowpublic EntityFullJid asEntityFullJidOrThrow() Description copied from interface:JidConvert this Jid to aEntityFullJidor throw anIllegalStateExceptionif this is not possible.- Specified by:
- asEntityFullJidOrThrowin interface- Jid
- Returns:
- the corresponding EntityFullJid.
 
 - 
asEntityJidOrThrowpublic EntityJid asEntityJidOrThrow() Description copied from interface:JidConvert this Jid to aEntityJidor throw anIllegalStateExceptionif this is not possible.- Specified by:
- asEntityJidOrThrowin interface- Jid
- Returns:
- the corresponding EntityJid.
 
 - 
asFullJidOrThrowpublic EntityFullJid asFullJidOrThrow() Description copied from interface:JidConvert this Jid to aFullJidor throw anIllegalStateExceptionif this is not possible.- Specified by:
- asFullJidOrThrowin interface- Jid
- Returns:
- the corresponding FullJid.
 
 - 
asDomainFullJidOrThrowpublic DomainFullJid asDomainFullJidOrThrow() Description copied from interface:JidConvert this Jid to aDomainFullJidor throw anIllegalStateExceptionif this is not possible.- Specified by:
- asDomainFullJidOrThrowin interface- Jid
- Returns:
- the corresponding DomainFullJid.
 
 - 
getResourceOrNullpublic abstract 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 interface- Jid
- Returns:
- the resource of this JID or null.
 
 - 
getResourceOrEmptypublic final Resourcepart getResourceOrEmpty() Description copied from interface:JidGet the resourcepart of this JID or return the empty resourcepart.If the JID is of form <localpart@domain.example/resource>then this method returns 'resource'. If the JID no resourcepart, thenResourcepart.EMPTYis returned.- Specified by:
- getResourceOrEmptyin interface- Jid
- Returns:
- the resource of this JID or the empty resourcepart.
 
 - 
getResourceOrThrowpublic final Resourcepart getResourceOrThrow() Description copied from interface:JidGet the resourcepart of this JID or throw anIllegalStateException.If the JID is of form <localpart@domain.example/resource>then this method returns 'resource'. If the JID no resourcepart, then anIllegalStateExceptionis thrown.- Specified by:
- getResourceOrThrowin interface- Jid
- Returns:
- the resource of this JID.
 
 - 
getLocalpartOrNullpublic abstract 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 interface- Jid
- Returns:
- the localpart of this JID or null.
 
 - 
getLocalpartOrThrowpublic final Localpart getLocalpartOrThrow() Description copied from interface:JidGet the localpart of this JID or throw anIllegalStateException.If the JID is of form <localpart@domain.example>then this method returns 'localpart'. If the JID has no localpart, thennullis returned.- Specified by:
- getLocalpartOrThrowin interface- Jid
- Returns:
- the localpart of this JID.
 
 - 
isParentOfpublic final boolean isParentOf(Jid jid) Description copied from interface:JidCheck if this JID is the parent of another JID. The parent of relation is defined, under the precondition that the JID parts (localpart, domainpart and resourcepart) are equal, as follows:| this JID (parentOf) | other JID | result | |---------------------+---------------------+--------| | dom.example | dom.example | true | | dom.example | dom.example/res | true | | dom.example | loc@dom.example | true | | dom.example | loc@dom.example/res | true | | dom.example/res | dom.exmple | false | | dom.example/res | dom.example/res | true | | dom.example/res | loc@dom.example | false | | dom.example/res | loc@dom.example/res | false | | loc@dom.example | dom.example | false | | loc@dom.example | dom.example/res | false | | loc@dom.example | loc@dom.example | true | | loc@dom.example | loc@dom.example/res | true | | loc@dom.example/res | dom.example | false | | loc@dom.example/res | dom.example/res | false | | loc@dom.example/res | loc@dom.example | false | | loc@dom.example/res | loc@dom.example/res | true | - Specified by:
- isParentOfin interface- Jid
- Parameters:
- jid- the other JID to compare with
- Returns:
- true if this JID is a parent of the given JID.
 
 - 
equalspublic final boolean equals(CharSequence charSequence) Description copied from interface:JidCompares the given CharSequence with this JID. Returns true ifequals(charSequence.toString()would return true.- Specified by:
- equalsin interface- Jid
- Parameters:
- charSequence- the CharSequence to compare this JID with.
- Returns:
- true if if equals(charSequence.toString()would return true.
- See Also:
- Jid.equals(String)
 
 - 
equalspublic final boolean equals(String string) Description copied from interface:JidCompares the given String wit this JID.Returns true if toString().equals(string), that is if the String representation of this JID matches the given string.
 - 
compareTopublic final int compareTo(Jid other) - Specified by:
- compareToin interface- Comparable<Jid>
 
 - 
internpublic final String intern() Description copied from interface:JidReturns the canonical String representation of this JID. SeeString.intern()for details.
 - 
asUrlEncodedStringpublic final String asUrlEncodedString() Description copied from interface:JidGet the URL encoded version of this JID.- Specified by:
- asUrlEncodedStringin interface- Jid
- Returns:
- the URL encoded version of this JID.
 
 
- 
 
-