Skip to content

Commit

Permalink
Add JidUtil.jidSetFrom(String[])
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Apr 14, 2015
1 parent bddfc0d commit f2edc85
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions jxmpp-jid/src/main/java/org/jxmpp/jid/util/JidUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.jxmpp.jid.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -262,6 +263,19 @@ public static void bareJidsFrom(Collection<? extends CharSequence> jidStrings, C
}
}

/**
* Convert the given array of Strings to JIDs.
* <p>
* Note that errors while converting the Strings will be silently ignored.
* </p>
*
* @param jids a array of JID Strings.
* @return a set of JIDs.
*/
public static Set<Jid> jidSetFrom(String[] jids) {
return jidSetFrom(Arrays.asList(jids));
}

/**
* Convert the given collection of CharSequences to JIDs.
*
Expand Down

0 comments on commit f2edc85

Please sign in to comment.