/**
* Property name.
*/
- private String _property;
+ private String property;
/**
* Regular expression.
*/
- private Pattern _regex;
+ private Pattern regex;
/**
* Whether or not to convert the value to lowercase before matching.
*/
- private boolean _tolower;
+ private boolean tolower;
/**
* Constructs the condition.
* @param aTolower Whether or not to convert the value to lowercase before matching.
*/
public PropertyRegexCondition(String aProperty, String aRegex, boolean aTolower) {
- _property = aProperty;
- _regex = Pattern.compile(aRegex);
- _tolower = aTolower;
+ property = aProperty;
+ regex = Pattern.compile(aRegex);
+ tolower = aTolower;
}
/* (non-Javadoc)
*/
public boolean matches(T aObject) {
try {
- String value = PropertyUtils.getProperty(aObject, _property) + "";
- if ( _tolower ) {
+ String value = PropertyUtils.getProperty(aObject, property) + "";
+ if ( tolower ) {
value = value.toLowerCase();
}
- Matcher matcher = _regex.matcher(value);
+ Matcher matcher = regex.matcher(value);
return matcher.matches();
} catch (IllegalAccessException e) {
throw new RuntimeException(e.getMessage(), e);