org.wamblee.conditions
Class PropertyRegexCondition<T>

java.lang.Object
  extended by org.wamblee.conditions.PropertyRegexCondition<T>
All Implemented Interfaces:
Condition<T>

public class PropertyRegexCondition<T>
extends java.lang.Object
implements Condition<T>

Condition to check whether a given property value matches a certain regular expression.

Author:
Erik Brakkee

Constructor Summary
PropertyRegexCondition(java.lang.String aProperty, java.lang.String aRegex, boolean aTolower)
          Constructs the condition.
 
Method Summary
 boolean matches(T aObject)
          Determines if an object matches a condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyRegexCondition

public PropertyRegexCondition(java.lang.String aProperty,
                              java.lang.String aRegex,
                              boolean aTolower)
Constructs the condition.

Parameters:
aProperty - Name of the property to examine.
aRegex - Regular expression to use.
aTolower - Whether or not to convert the value to lowercase before matching.
Method Detail

matches

public boolean matches(T aObject)
Description copied from interface: Condition
Determines if an object matches a condition.

Specified by:
matches in interface Condition<T>
Parameters:
aObject - object to match.
Returns:
True iff the object matches.


Copyright © 2010. All Rights Reserved.