X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fconditions%2FPropertyRegexCondition.java;h=cfc1e1655784c203699f2d4d6b10f71082cf0b39;hb=0d8d8f24656e585ee75558cfd6a4c661f8f14985;hp=2ce7a0e9700196116f1c74fc56c0a7fefdb361e9;hpb=da48a523c81e59fe0eac34e43d12937396161f25;p=utils diff --git a/support/general/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java b/support/general/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java index 2ce7a0e9..cfc1e165 100644 --- a/support/general/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java +++ b/support/general/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java @@ -33,17 +33,17 @@ public class PropertyRegexCondition implements Condition { /** * 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. @@ -52,9 +52,9 @@ public class PropertyRegexCondition implements 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) @@ -62,11 +62,11 @@ public class PropertyRegexCondition implements Condition { */ 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);