public class Resourcepart extends Part
You can create instances of this class from Strings using from(String)
.
Modifier and Type | Field and Description |
---|---|
static Resourcepart |
EMPTY
The empty resource part.
|
Modifier and Type | Method and Description |
---|---|
static Resourcepart |
from(String resource)
Get the
Resourcepart representing the input String. |
static Resourcepart |
fromOrNull(CharSequence cs)
|
static Resourcepart |
fromOrThrowUnchecked(CharSequence cs)
Like
from(String) but does throw an unchecked IllegalArgumentException instead of a
XmppStringprepException . |
assertNotLongerThan1023BytesOrEmpty, charAt, equals, hashCode, intern, length, subSequence, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
chars, codePoints
public static final Resourcepart EMPTY
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.
public static Resourcepart fromOrNull(CharSequence cs)
cs
- the input CharSequencenull
public static Resourcepart fromOrThrowUnchecked(CharSequence cs)
from(String)
but does throw an unchecked IllegalArgumentException
instead of a
XmppStringprepException
.cs
- the character sequence which should be transformed to a Resourcepart
Resourcepart
if no exception occursIllegalArgumentException
- if the given input is not a valid Resourcepart
from(String)
public static Resourcepart from(String resource) throws XmppStringprepException
Resourcepart
representing the input String.resource
- the input String.XmppStringprepException
- if an error occurs.