Package org.jxmpp.jid.parts
Class Domainpart
- java.lang.Object
-
- org.jxmpp.jid.parts.Part
-
- org.jxmpp.jid.parts.Domainpart
-
- All Implemented Interfaces:
Serializable
,CharSequence
public class Domainpart extends Part
A domainpart of an XMPP address (JID).You can create instances of this class from Strings using
from(String)
.- See Also:
- RFC 6122 ยง 2.2. Domainpart, Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Domainpart
from(String domain)
Get theDomainpart
representing the input String.static Domainpart
from(String domain, JxmppContext context)
Get theDomainpart
representing the input String.static Domainpart
fromOrNull(CharSequence cs)
static Domainpart
fromOrThrowUnchecked(CharSequence cs)
Likefrom(String)
but does throw an uncheckedIllegalArgumentException
instead of aXmppStringprepException
.-
Methods inherited from class org.jxmpp.jid.parts.Part
assertNotLongerThan1023BytesOrEmpty, charAt, equals, hashCode, intern, length, subSequence, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Method Detail
-
fromOrNull
public static Domainpart fromOrNull(CharSequence cs)
- Parameters:
cs
- the input CharSequence- Returns:
- a Domainpart or
null
-
fromOrThrowUnchecked
public static Domainpart fromOrThrowUnchecked(CharSequence cs)
Likefrom(String)
but does throw an uncheckedIllegalArgumentException
instead of aXmppStringprepException
.- Parameters:
cs
- the character sequence which should be transformed to aDomainpart
- Returns:
- the
Domainpart
if no exception occurs - Throws:
IllegalArgumentException
- if the given input is not a validDomainpart
- Since:
- 0.6.2
- See Also:
from(String)
-
from
public static Domainpart from(String domain) throws XmppStringprepException
Get theDomainpart
representing the input String.- Parameters:
domain
- the input String.- Returns:
- the domainpart.
- Throws:
XmppStringprepException
- if an error occurs.
-
from
public static Domainpart from(String domain, JxmppContext context) throws XmppStringprepException
Get theDomainpart
representing the input String.- Parameters:
domain
- the input String.context
- the JXMPP context.- Returns:
- the domainpart.
- Throws:
XmppStringprepException
- if an error occurs.
-
-