org.datamanager.constraint
Class StringValueContainsConstraint

java.lang.Object
  |
  +--org.datamanager.kernel.AbstractEntityConstraint
        |
        +--org.datamanager.constraint.StringValueContainsConstraint
All Implemented Interfaces:
Constraint, EntityConstraint, EntityValue, Serializable

public class StringValueContainsConstraint
extends AbstractEntityConstraint

Matches a StringEntityValue with any given String. This class matches any Entity that has a StringEntityValue that contains the String given in the constructor of this class. Currently this constraint only does an indexOf() to see if the value contains the given String.

Author:
Matthew Farrellee
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.datamanager.kernel.AbstractEntityConstraint
DEBUG_ACCEPTS_MESSAGE
 
Fields inherited from interface org.datamanager.constraint.EntityConstraint
NONE
 
Constructor Summary
StringValueContainsConstraint(String value)
          The default constructor.
 
Method Summary
protected  boolean describes(Entity defendant)
          Decide if the Entity is valid or not.
 
Methods inherited from class org.datamanager.kernel.AbstractEntityConstraint
accepts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValueContainsConstraint

public StringValueContainsConstraint(String value)
The default constructor. It uses indexOf() to find the given String in a StringEntityValue.

Method Detail

describes

protected boolean describes(Entity defendant)
                     throws DataManagerException
Decide if the Entity is valid or not. It uses indexOf() to find the given String in a StringEntityValue.

Specified by:
describes in class AbstractEntityConstraint
Parameters:
defendant - An entity to check.
Returns:
Whether the entity is acceptable or not.
DataManagerException


See the Helium Website