C - the effective type of constraint generated by this builderpublic class CSVFilter<C extends Constraint> extends Object
customSplitter(String) to split by a custom Regular Expression.
Therefore the constraint translates x,y,z for field f to: f = x OR f = y OR f = z. Empty strings
are gracefully handled (ignored). If orEmpty() is used, the constraint also succeeds if
the target field is empty. This is only valid when containsAny is used.
| Modifier and Type | Class and Description |
|---|---|
static class |
CSVFilter.Mode
Specifies the matching mode for a filter.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
commaSeparatedValues |
protected static String |
DEFAULT_SPLITTER |
protected FilterFactory<C> |
factory |
protected Mapping |
field |
protected boolean |
lowercaseValues |
protected CSVFilter.Mode |
mode |
protected boolean |
orEmpty |
protected String |
splitter |
protected boolean |
uppercaseValues |
| Modifier | Constructor and Description |
|---|---|
protected |
CSVFilter(FilterFactory<C> factory,
Mapping field,
String value,
CSVFilter.Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
C |
build()
Generates the effective constraint.
|
protected List<String> |
collectValues() |
CSVFilter<C> |
customSplitter(String customSplitter)
Signals that this constraint should split the give values String using the given Regular Expression
|
CSVFilter<C> |
lowercaseValues()
Signals that this constraint should convert the values to lowercase before being applied
|
CSVFilter<C> |
orEmpty()
Signals the constraint to also accept an empty target field if containsAny is used.
|
CSVFilter<C> |
uppercaseValues()
Signals that this constraint should convert the values to uppercase before being applied
|
protected static final String DEFAULT_SPLITTER
protected FilterFactory<C extends Constraint> factory
protected final Mapping field
protected boolean orEmpty
protected CSVFilter.Mode mode
protected String commaSeparatedValues
protected String splitter
protected boolean lowercaseValues
protected boolean uppercaseValues
protected CSVFilter(FilterFactory<C> factory, Mapping field, String value, CSVFilter.Mode mode)
public CSVFilter<C> lowercaseValues()
public CSVFilter<C> uppercaseValues()
public CSVFilter<C> customSplitter(String customSplitter)
customSplitter - a Regular Expression used to splitpublic CSVFilter<C> orEmpty()
public C build()
Query.Copyright © 2018. All rights reserved.