Top Description Constructors Methods
ch.qos.logback.core.util

public Class StringCollectionUtil

extends Object
Class Inheritance
Imports
java.util.Arrays, .ArrayList, .Collection, .List, java.util.regex.Pattern

Static utility methods for working with collections of strings.
Author
Carl Harris

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
removeMatching(Collection<String>
subject value collection
values
,
String...
patterns to match
patterns
)

Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.

public static void
removeMatching(Collection<String>
subject value collection
values
,
Collection<String>
patterns to match
patterns
)

Removes all values in the subject collection that are matched by at least one of a collection of regular expressions.

public static void
retainMatching(Collection<String>
subject value collection
values
,
String...
patterns to match
patterns
)

Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.

public static void
retainMatching(Collection<String>
subject value collection
values
,
Collection<String>
patterns to match
patterns
)

Retains all values in the subject collection that are matched by at least one of a collection of regular expressions.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StringCollectionUtilback to summary
public StringCollectionUtil()

Method Detail

removeMatchingback to summary
public static void removeMatching(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.

This method is a convenience overload for removeMatching(Collection, Collection).

Parameters
values:Collection<String>

subject value collection

patterns:String[]

patterns to match

removeMatchingback to summary
public static void removeMatching(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.

The semantics of this method are conceptually similar to Collection#removeAll(Collection), but uses pattern matching instead of exact matching.

Parameters
values:Collection<String>

subject value collection

patterns:Collection<String>

patterns to match

retainMatchingback to summary
public static void retainMatching(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.

This method is a convenience overload for retainMatching(Collection, Collection).

Parameters
values:Collection<String>

subject value collection

patterns:String[]

patterns to match

retainMatchingback to summary
public static void retainMatching(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.

The semantics of this method are conceptually similar to Collection#retainAll(Collection), but uses pattern matching instead of exact matching.

Parameters
values:Collection<String>

subject value collection

patterns:Collection<String>

patterns to match