Package org.jxmpp.jid.parts
Class Domainpart
- java.lang.Object
-
- org.jxmpp.jid.parts.Part
-
- org.jxmpp.jid.parts.Domainpart
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.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(java.lang.String domain)
Get theDomainpart
representing the input String.static Domainpart
from(java.lang.String domain, JxmppContext context)
Get theDomainpart
representing the input String.static Domainpart
fromOrNull(java.lang.CharSequence cs)
static Domainpart
fromOrThrowUnchecked(java.lang.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
-
-
-
-
Method Detail
-
fromOrNull
public static Domainpart fromOrNull(java.lang.CharSequence cs)
- Parameters:
cs
- the input CharSequence- Returns:
- a Domainpart or
null
-
fromOrThrowUnchecked
public static Domainpart fromOrThrowUnchecked(java.lang.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:
java.lang.IllegalArgumentException
- if the given input is not a validDomainpart
- Since:
- 0.6.2
- See Also:
from(String)
-
from
public static Domainpart from(java.lang.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(java.lang.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.
-
-