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 Domainpartfrom(String domain)Get theDomainpartrepresenting the input String.static Domainpartfrom(String domain, JxmppContext context)Get theDomainpartrepresenting the input String.static DomainpartfromOrNull(CharSequence cs)static DomainpartfromOrThrowUnchecked(CharSequence cs)Likefrom(String)but does throw an uncheckedIllegalArgumentExceptioninstead 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 uncheckedIllegalArgumentExceptioninstead of aXmppStringprepException.- Parameters:
cs- the character sequence which should be transformed to aDomainpart- Returns:
- the
Domainpartif 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 theDomainpartrepresenting 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 theDomainpartrepresenting the input String.- Parameters:
domain- the input String.context- the JXMPP context.- Returns:
- the domainpart.
- Throws:
XmppStringprepException- if an error occurs.
-
-