public class SetUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isEmpty(Object obj)
Returns true if obj is not a Collection (including if obj ==
null) or if obj is an empty Collection.
|
static String |
plistMatch(List<String> plist,
String key)
Returns the first String value indexed by a String regex matching
key in the property list plist, else returns an empty String
if no regex in plist matches key.
|
static void |
removeByPattern(List seq,
String regex)
Filters the List of Strings seq, removing all items that match
the regular expression pattern regex.
|
static void |
removeDuplicates(Collection collection)
Removes duplicates from collection based on its natural
comparator or equality operator.
|
static void |
retainByPattern(List seq,
String regex)
Filters the List of Strings seq, retaining only items that match
the regular expression pattern regex.
|
public static void removeDuplicates(Collection collection)
collection - The collection from which duplicate elements
are to be removed.public static boolean isEmpty(Object obj)
obj - The Object to be tested, presumably with the
expectation that it could be a Collectionpublic static String plistMatch(List<String> plist, String key)
plist - A property list (cf. LISP) containing an even
number of Strings, which are understood to be consecutive
regex/value pairskey - A String that will be matched against the regular
expressions in plist.public static void removeByPattern(List seq, String regex)
seq - A List of Stringsregex - A regular expression pattern String that will be
matched against the Strings in seqpublic static void retainByPattern(List seq, String regex)
seq - A List of Stringsregex - A regular expression pattern String that will be
matched against the Strings in seqCopyright © 2015. All rights reserved.