public class StringCollectionFilter extends AStringFilter
ALL, NONE
Constructor and Description |
---|
StringCollectionFilter(java.util.Collection<java.lang.String> strings)
Initialize the new instance with a collection of strings.
|
StringCollectionFilter(java.lang.String strings)
Initialize the new instance with a List of strings provided as one
string where the values are separated by comma (",").
|
StringCollectionFilter(java.lang.String[] strings)
Initialize the new instance with an array of strings.
|
StringCollectionFilter(java.lang.String strings,
java.lang.String separators)
Initialize the new instance with a List of strings provided as one
string where the values are separated by the specified separators.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String... strings)
Add the given strings to the internal string collection.
|
protected void |
addSingleString(java.lang.String string)
Add the given string to the internal string collection.
|
static StringCollectionFilter |
create(java.lang.String... strings)
A factory method that supports a variable number of strings.
|
boolean |
getIgnoreCase()
Returns true if the string comparison is done case-insensitive
|
protected java.lang.String[] |
getInternalStrings() |
boolean |
matches(java.lang.String string)
Returns true if the given string is in the internal collection of strings.
|
boolean |
matchesIfInCollection()
Returns true if this filter matches a string if it is found in the
internal collection.
|
void |
negate()
Inverts the (match) logic of this filter
|
void |
setIgnoreCase(boolean newValue)
Sets whether or not the string comparison is done case-insensitive
|
protected void |
setInternalStrings(java.lang.String[] newValue) |
protected StringUtil |
str() |
public StringCollectionFilter(java.lang.String[] strings)
strings
- The strings that define the set that matches this filterpublic StringCollectionFilter(java.util.Collection<java.lang.String> strings)
strings
- A list that must only contain String objectspublic StringCollectionFilter(java.lang.String strings, java.lang.String separators)
strings
- The strings to add (separated values)separators
- Each character is treated as a separator between two string valuespublic StringCollectionFilter(java.lang.String strings)
strings
- The strings to add (comma separated values)public static StringCollectionFilter create(java.lang.String... strings)
public boolean matches(java.lang.String string)
string
- The string to look up in the collectionpublic void negate()
public boolean matchesIfInCollection()
public void add(java.lang.String... strings)
public boolean getIgnoreCase()
public void setIgnoreCase(boolean newValue)
protected void addSingleString(java.lang.String string)
protected java.lang.String[] getInternalStrings()
protected void setInternalStrings(java.lang.String[] newValue)
protected StringUtil str()