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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Resourcepart
from
(CharSequence resource) Get theResourcepart
representing the input String.static Resourcepart
Get theResourcepart
representing the input String.static Resourcepart
from
(String resource, JxmppContext context) Get theResourcepart
representing the input String.static Resourcepart
static Resourcepart
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
-
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
null
values, 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 uncheckedIllegalArgumentException
instead of aXmppStringprepException
.- Parameters:
cs
- the character sequence which should be transformed to aResourcepart
- Returns:
- the
Resourcepart
if no exception occurs - Throws:
IllegalArgumentException
- if the given input is not a validResourcepart
- Since:
- 0.6.2
- See Also:
-
from
Get theResourcepart
representing the input String.- Parameters:
resource
- the input String.- Returns:
- the resource part.
- Throws:
XmppStringprepException
- if an error occurs.
-
from
Get theResourcepart
representing 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 theResourcepart
representing the input String.- Parameters:
resource
- the input String.context
- the JXMPP context.- Returns:
- the resource part.
- Throws:
XmppStringprepException
- if an error occurs.
-