java.lang.Object
ch.qos.logback.core.util.StringCollectionUtil
Static utility methods for working with collections of strings.
- Author:
- Carl Harris
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidremoveMatching(Collection<String> values, String... patterns) Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.static voidremoveMatching(Collection<String> values, Collection<String> patterns) Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.static voidretainMatching(Collection<String> values, String... patterns) Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.static voidretainMatching(Collection<String> values, Collection<String> patterns) Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.
-
Constructor Details
-
StringCollectionUtil
public StringCollectionUtil()
-
-
Method Details
-
retainMatching
Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.This method is a convenience overload for
retainMatching(Collection, Collection).- Parameters:
values- subject value collectionpatterns- patterns to match
-
retainMatching
Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.The semantics of this method are conceptually similar to
Collection.retainAll(Collection), but uses pattern matching instead of exact matching.- Parameters:
values- subject value collectionpatterns- patterns to match
-
removeMatching
Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.This method is a convenience overload for
removeMatching(Collection, Collection).- Parameters:
values- subject value collectionpatterns- patterns to match
-
removeMatching
Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.The semantics of this method are conceptually similar to
Collection.removeAll(Collection), but uses pattern matching instead of exact matching.- Parameters:
values- subject value collectionpatterns- patterns to match
-