public class Localpart extends Part
You can create instances of this class from Strings using from(String).
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
asUnescapedString()
Return the unescaped String representation of this Localpart.
|
static Localpart |
from(java.lang.String localpart)
Get the
Localpart representing the input String. |
static Localpart |
fromOrThrowUnchecked(java.lang.CharSequence cs)
Like
from(String) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
static Localpart |
fromUnescaped(java.lang.CharSequence unescapedLocalpart)
Get a
Localpart from an unescaped CharSequence. |
static Localpart |
fromUnescaped(java.lang.String unescapedLocalpart)
Get a
Localpart from an unescaped String. |
static Localpart |
fromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
Like
fromUnescaped(String) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException. |
assertNotLongerThan1023BytesOrEmpty, charAt, equals, hashCode, intern, length, subSequence, toStringpublic java.lang.String asUnescapedString()
Since certain Unicode code points are disallowed in the localpart of a JID by the required stringprep profile, those need to get escaped when used in a real JID. The unescaped representation of the JID is only for presentation to a human user or for gatewaying to a non-XMPP system.
Jid.asUnescapedString()public static Localpart fromOrThrowUnchecked(java.lang.CharSequence cs)
from(String) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a LocalpartLocalpart if no exception occursjava.lang.IllegalArgumentException - if the given input is not a valid Localpartfrom(String)public static Localpart fromUnescapedOrThrowUnchecked(java.lang.CharSequence cs)
fromUnescaped(String) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException.cs - the character sequence which should be transformed to a LocalpartLocalpart if no exception occursfrom(String)public static Localpart fromUnescaped(java.lang.String unescapedLocalpart) throws org.jxmpp.stringprep.XmppStringprepException
Localpart from an unescaped String.unescapedLocalpart - an unescaped String representing a Localpart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static Localpart fromUnescaped(java.lang.CharSequence unescapedLocalpart) throws org.jxmpp.stringprep.XmppStringprepException
Localpart from an unescaped CharSequence.unescapedLocalpart - an unescaped CharSequence representing a Localpart.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.public static Localpart from(java.lang.String localpart) throws org.jxmpp.stringprep.XmppStringprepException
Localpart representing the input String.localpart - the input String.org.jxmpp.stringprep.XmppStringprepException - if an error occurs.