Class CsvFilterElement
java.lang.Object
com.puppycrawl.tools.checkstyle.filters.CsvFilterElement
- All Implemented Interfaces:
IntFilterElement
This filter element is immutable and accepts an integer that matches a CSV value, where
each value is an integer or a range of integers.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCsvFilterElement
(String pattern) Constructs aCsvFilterElement
from a CSV, Comma-Separated Values, string. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(int intValue) Determines whether an Integer matches a CSV integer value.private void
addFilter
(IntFilterElement filter) Adds a IntFilterElement to the set.boolean
protected Set<IntFilterElement>
Returns the IntFilters of the filter set.int
hashCode()
-
Field Details
-
filters
Filter set.
-
-
Constructor Details
-
CsvFilterElement
CsvFilterElement(String pattern) Constructs aCsvFilterElement
from a CSV, Comma-Separated Values, string. Each value is an integer, or a range of integers. A range of integers is of the form integer-integer, such as 1-10. Note: integers must be non-negative.- Parameters:
pattern
- the CSV string.- Throws:
NumberFormatException
- if a component substring does not contain a parsable integer.
-
-
Method Details
-
addFilter
Adds a IntFilterElement to the set.- Parameters:
filter
- the IntFilterElement to add.
-
getFilters
Returns the IntFilters of the filter set.- Returns:
- the IntFilters of the filter set.
-
accept
Determines whether an Integer matches a CSV integer value.- Specified by:
accept
in interfaceIntFilterElement
- Parameters:
intValue
- the Integer to check.- Returns:
- true if intValue is an Integer that matches a CSV value.
-
equals
-
hashCode
-