org.jminor.common.model
Class RegexFilterCriteria<T>
java.lang.Object
org.jminor.common.model.RegexFilterCriteria<T>
- All Implemented Interfaces:
- FilterCriteria<T>
public final class RegexFilterCriteria<T>
- extends Object
- implements FilterCriteria<T>
A FilterCriteria implementation based on a regular expression.
Method Summary |
boolean |
include(T item)
Returns true if the regex pattern is valid and the given item passes the criteria. |
boolean |
isPatternValid()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexFilterCriteria
public RegexFilterCriteria(String patternString)
- Instantiates a new RegexFilterCriteria.
- Parameters:
patternString
- the regex pattern
RegexFilterCriteria
public RegexFilterCriteria(String patternString,
boolean caseSensitive)
- Instantiates a new RegexFilterCriteria.
- Parameters:
patternString
- the regex patterncaseSensitive
- if true then this criteria is case sensitive
isPatternValid
public boolean isPatternValid()
- Returns:
- true if the pattern is valid.
include
public boolean include(T item)
- Returns true if the regex pattern is valid and the given item passes the criteria.
- Specified by:
include
in interface FilterCriteria<T>
- Parameters:
item
- the item
- Returns:
- true if the item should be included