Package org.jxmpp.jid.parts
Class Resourcepart
java.lang.Object
org.jxmpp.jid.parts.Part
org.jxmpp.jid.parts.Resourcepart
- All Implemented Interfaces:
Serializable,CharSequence
A resourcepart of an XMPP address (JID).
You can create instances of this class from Strings using from(String).
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Resourcepartfrom(CharSequence resource) Get theResourcepartrepresenting the input String.static ResourcepartGet theResourcepartrepresenting the input String.static Resourcepartfrom(String resource, JxmppContext context) Get theResourcepartrepresenting the input String.static Resourcepartstatic ResourcepartLikefrom(String)but does throw an uncheckedIllegalArgumentExceptioninstead of aXmppStringprepException.Methods inherited from class org.jxmpp.jid.parts.Part
assertNotLongerThan1023BytesOrEmpty, charAt, equals, hashCode, intern, length, subSequence, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Field Details
-
EMPTY
The empty resource part.This empty resource part is the part that is represented by the empty String. This is useful in cases where you have a collection of Resourceparts that does not allow
nullvalues, but you want to deal with the "no resource" case.
-
-
Method Details
-
fromOrNull
- Parameters:
cs- the input CharSequence- Returns:
- a Resourcepart or
null
-
fromOrThrowUnchecked
Likefrom(String)but does throw an uncheckedIllegalArgumentExceptioninstead of aXmppStringprepException.- Parameters:
cs- the character sequence which should be transformed to aResourcepart- Returns:
- the
Resourcepartif no exception occurs - Throws:
IllegalArgumentException- if the given input is not a validResourcepart- Since:
- 0.6.2
- See Also:
-
from
Get theResourcepartrepresenting the input String.- Parameters:
resource- the input String.- Returns:
- the resource part.
- Throws:
XmppStringprepException- if an error occurs.
-
from
Get theResourcepartrepresenting the input String.- Parameters:
resource- the input String.- Returns:
- the resource part.
- Throws:
XmppStringprepException- if an error occurs.
-
from
public static Resourcepart from(String resource, JxmppContext context) throws XmppStringprepException Get theResourcepartrepresenting the input String.- Parameters:
resource- the input String.context- the JXMPP context.- Returns:
- the resource part.
- Throws:
XmppStringprepException- if an error occurs.
-