public class JidUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JidUtil.NotAEntityBareJidStringException |
| Constructor and Description |
|---|
JidUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<EntityBareJid> |
entityBareJidSetFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings)
Convert the given collection of CharSequences to bare JIDs.
|
static void |
entityBareJidsFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings,
java.util.Collection<? super EntityBareJid> output,
java.util.List<org.jxmpp.stringprep.XmppStringprepException> exceptions)
Convert a collection of Strings to a Set of
EntityBareJid's. |
static void |
filterDomainFullJid(java.util.Collection<? extends Jid> in,
java.util.Collection<? super DomainFullJid> out)
Filter all domain full JIDs.
|
static java.util.List<DomainFullJid> |
filterDomainFullJidList(java.util.Collection<? extends Jid> input)
Filter all domain full JIDs.
|
static java.util.Set<DomainFullJid> |
filterDomainFullJidSet(java.util.Collection<? extends Jid> input)
Filter all domain full JIDs.
|
static void |
filterEntityBareJid(java.util.Collection<? extends Jid> in,
java.util.Collection<? super EntityBareJid> out)
Filter all entity bare JIDs.
|
static java.util.List<EntityBareJid> |
filterEntityBareJidList(java.util.Collection<? extends Jid> input)
Filter all entity bare JIDs.
|
static java.util.Set<EntityBareJid> |
filterEntityBareJidSet(java.util.Collection<? extends Jid> input)
Filter all entity bare JIDs.
|
static void |
filterEntityFullJid(java.util.Collection<? extends Jid> in,
java.util.Collection<? super EntityFullJid> out)
Filter all entity full JIDs.
|
static java.util.List<EntityFullJid> |
filterEntityFullJidList(java.util.Collection<? extends Jid> input)
Filter all full JIDs.
|
static java.util.Set<EntityFullJid> |
filterEntityFullJidSet(java.util.Collection<? extends Jid> input)
Filter all full JIDs.
|
static boolean |
isValidEntityBareJid(java.lang.CharSequence jid)
Check if the given CharSequence represents a valid entity bare JID.
|
static java.util.Set<Jid> |
jidSetFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings)
Convert the given collection of CharSequences to JIDs.
|
static java.util.Set<Jid> |
jidSetFrom(java.lang.String[] jids)
Convert the given array of Strings to JIDs.
|
static void |
jidsFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings,
java.util.Collection<? super Jid> output,
java.util.List<org.jxmpp.stringprep.XmppStringprepException> exceptions)
Convert a collection of Strings to a Set of
Jid's. |
static java.util.List<java.lang.String> |
toStringList(java.util.Collection<? extends Jid> jids)
Convert a collection of JIDs to a list of Strings representing those JIDs.
|
static void |
toStrings(java.util.Collection<? extends Jid> jids,
java.util.Collection<? super java.lang.String> jidStrings)
Convert a collection of JIDs to a Collection of Strings.
|
static java.util.Set<java.lang.String> |
toStringSet(java.util.Collection<? extends Jid> jids)
convert a collection of JIDs to a set of Strings representing those JIDs.
|
static EntityBareJid |
validateEntityBareJid(java.lang.CharSequence jidcs)
Check if the given CharSequence is a valid entity bare JID.
|
public static boolean isValidEntityBareJid(java.lang.CharSequence jid)
This method is meant to validate user input and give fast feedback (e.g. with a red or green light) about if the user entered CharSequence represents a bare JID.
jid - the CharSequence to check.EntityBareJidpublic static EntityBareJid validateEntityBareJid(java.lang.CharSequence jidcs) throws JidUtil.NotAEntityBareJidStringException, org.jxmpp.stringprep.XmppStringprepException
This is a convenience method meant to validate user entered bare JIDs. If
the given jid is not a valid bare JID, then this method will
throw either JidUtil.NotAEntityBareJidStringException or
XmppStringprepException. The NotABareJidStringException will
contain a meaningful message explaining why the given CharSequence is not a
valid bare JID (e.g. "does not contain a '@' character").
jidcs - the JID CharSequenceJidUtil.NotAEntityBareJidStringException - if the given CharSequence is not a bare JID.org.jxmpp.stringprep.XmppStringprepException - if an error happens.public static void filterEntityBareJid(java.util.Collection<? extends Jid> in, java.util.Collection<? super EntityBareJid> out)
in - the input collection.out - the collection where the filtered JIDs are added to.public static java.util.Set<EntityBareJid> filterEntityBareJidSet(java.util.Collection<? extends Jid> input)
input - the input collection.public static java.util.List<EntityBareJid> filterEntityBareJidList(java.util.Collection<? extends Jid> input)
input - the input collection.public static void filterEntityFullJid(java.util.Collection<? extends Jid> in, java.util.Collection<? super EntityFullJid> out)
in - the input collection.out - the collection where the filtered JIDs are added to.public static java.util.Set<EntityFullJid> filterEntityFullJidSet(java.util.Collection<? extends Jid> input)
input - the input collection.public static java.util.List<EntityFullJid> filterEntityFullJidList(java.util.Collection<? extends Jid> input)
input - the input collection.public static void filterDomainFullJid(java.util.Collection<? extends Jid> in, java.util.Collection<? super DomainFullJid> out)
in - the input collection.out - the collection where the filtered JIDs are added to.public static java.util.Set<DomainFullJid> filterDomainFullJidSet(java.util.Collection<? extends Jid> input)
input - the input collection.public static java.util.List<DomainFullJid> filterDomainFullJidList(java.util.Collection<? extends Jid> input)
input - the input collection.public static java.util.Set<EntityBareJid> entityBareJidSetFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings)
jidStrings - the collection of CharSequences.public static void entityBareJidsFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings,
java.util.Collection<? super EntityBareJid> output,
java.util.List<org.jxmpp.stringprep.XmppStringprepException> exceptions)
EntityBareJid's.
If the optional argument exceptions is given, then all XmppStringprepException thrown while
converting will be added to the list. Otherwise, if an XmppStringprepExceptions is thrown, it will be wrapped in
a AssertionError Exception and throw.
jidStrings - the strings that are going to get convertedoutput - the collection where the BareJid's will be added toexceptions - the list of exceptions thrown while converting.public static java.util.Set<Jid> jidSetFrom(java.lang.String[] jids)
Note that errors while converting the Strings will be silently ignored.
jids - a array of JID Strings.public static java.util.Set<Jid> jidSetFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings)
jidStrings - the collection of CharSequences.public static void jidsFrom(java.util.Collection<? extends java.lang.CharSequence> jidStrings,
java.util.Collection<? super Jid> output,
java.util.List<org.jxmpp.stringprep.XmppStringprepException> exceptions)
Jid's.
If the optional argument exceptions is given, then all XmppStringprepException thrown while
converting will be added to the list. Otherwise, if an XmppStringprepExceptions is thrown, it will be wrapped in
a AssertionError Exception and throw.
jidStrings - the strings that are going to get convertedoutput - the collection where the Jid's will be added toexceptions - the list of exceptions thrown while converting.public static java.util.List<java.lang.String> toStringList(java.util.Collection<? extends Jid> jids)
jids - a collection of JIDs.public static java.util.Set<java.lang.String> toStringSet(java.util.Collection<? extends Jid> jids)
jids - a collection of JIDs.public static void toStrings(java.util.Collection<? extends Jid> jids, java.util.Collection<? super java.lang.String> jidStrings)
jids - the collection of Strings to convert.jidStrings - the collection of Strings to append to.