public interface Jid extends Comparable<Jid>, CharSequence
This is the super interface for all JID types. Every JID consists at least of
a domainpart. You can retrieve the escaped String with toString()
or the unsecaped String of the JID with asUnescapedString()
.
Modifier and Type | Method and Description |
---|---|
BareJid |
asBareJidIfPossible()
Convert this Jid to a BareJid if possible.
|
DomainBareJid |
asDomainBareJidIfPossible()
Convert this Jid to a DomainBareJid if possible.
|
DomainFullJid |
asDomainFullJidIfPossible()
Convert this Jid to a DomainFullJid if possible.
|
FullJid |
asFullJidIfPossible()
Convert this Jid to a FullJid if possible.
|
String |
asUnescapedString() |
<T extends Jid> |
downcast()
Return the downcasted instance of this Jid.
|
boolean |
equals(CharSequence charSequence)
Compares the given CharSequence with this JID.
|
boolean |
equals(String string)
Compares the given String wit this JID.
|
String |
getDomain() |
String |
getLocalpartOrNull()
Get the localpart of this JID or null.
|
String |
getResourceOrNull()
Get the resourcepart of this JID or null.
|
boolean |
hasLocalpart() |
boolean |
hasNoResource()
Check if this is an instance of
BareJid or DomainBareJid . |
boolean |
hasResource() |
boolean |
isBareJid()
Check if this is an instance of
BareJid . |
boolean |
isBareOrFullJid() |
boolean |
isDomainBareJid()
Check if this is an instance of
DomainBareJid . |
boolean |
isDomainFullJid()
Check if this is an instance of
DomainFullJid . |
boolean |
isFullJid()
Check if this is an instance of
FullJid . |
boolean |
isParentOf(BareJid bareJid)
See
isParentOf(Jid) . |
boolean |
isParentOf(DomainBareJid domainBareJid)
See
isParentOf(Jid) . |
boolean |
isParentOf(DomainFullJid domainFullJid)
See
isParentOf(Jid) . |
boolean |
isParentOf(FullJid fullJid)
See
isParentOf(Jid) . |
boolean |
isParentOf(Jid jid)
Check if this JID is the parent of another JID.
|
String |
toString()
Returns the escaped String representation of this JID.
|
compareTo
charAt, chars, codePoints, length, subSequence
String getDomain()
String toString()
toString
in interface CharSequence
toString
in class Object
String asUnescapedString()
boolean isBareOrFullJid()
boolean isBareJid()
BareJid
.boolean isFullJid()
FullJid
.boolean isDomainBareJid()
DomainBareJid
.boolean isDomainFullJid()
DomainFullJid
.boolean hasNoResource()
BareJid
or DomainBareJid
.boolean hasResource()
boolean hasLocalpart()
BareJid asBareJidIfPossible()
FullJid asFullJidIfPossible()
DomainBareJid asDomainBareJidIfPossible()
DomainFullJid asDomainFullJidIfPossible()
String getResourceOrNull()
If the JID is of form null
is returned.
String getLocalpartOrNull()
If the JID is of form null
is returned.
boolean isParentOf(Jid jid)
| 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 |
jid
- the other JID to compare withboolean isParentOf(BareJid bareJid)
isParentOf(Jid)
.bareJid
- boolean isParentOf(FullJid fullJid)
isParentOf(Jid)
.fullJid
- boolean isParentOf(DomainBareJid domainBareJid)
isParentOf(Jid)
.domainBareJid
- boolean isParentOf(DomainFullJid domainFullJid)
isParentOf(Jid)
.domainFullJid
- <T extends Jid> T downcast()
boolean equals(CharSequence charSequence)
equals(charSequence.toString()
would
return true.charSequence
- the CharSequence to compare this JID with.equals(charSequence.toString()
would return true.equals(String)
boolean equals(String string)
Returns true if toString().equals(string)
, that is if the String representation of this JID matches the given string.
string
- the String to compare this JID with.toString().equals(string)
.Copyright © 2016. All rights reserved.