org.springmodules.validation.util.condition.string
Class ContainsSubstringStringCondition
java.lang.Object
org.springmodules.validation.util.condition.AbstractCondition
org.springmodules.validation.util.condition.TypeSpecificCondition
org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition
org.springmodules.validation.util.condition.string.AbstractStringCondition
org.springmodules.validation.util.condition.string.ContainsSubstringStringCondition
- All Implemented Interfaces:
- Condition
public class ContainsSubstringStringCondition
- extends AbstractStringCondition
An AbstractStringCondition
implementation that checks whether the given strings contain a specific
sub-string.
- Author:
- Uri Boness
Method Summary |
protected boolean |
checkString(String text)
Checks whether the given text contains the sub-string associated with this condition. |
String |
getSubstring()
Returns the sub-string that is associated with this condition. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContainsSubstringStringCondition
public ContainsSubstringStringCondition(String substring)
- Constructs a new ContainsSubstringStringCondition with a given sub-string.
- Parameters:
substring
- The sub-string this condition will look for within the checked strings.
checkString
protected boolean checkString(String text)
- Checks whether the given text contains the sub-string associated with this condition.
- Specified by:
checkString
in class AbstractStringCondition
- Parameters:
text
- The string to be checked.
- Returns:
true
if the given text contains the sub-string, false
otherwise.
getSubstring
public String getSubstring()
- Returns the sub-string that is associated with this condition.
- Returns:
- The sub-string that is associated with this condition.
Copyright © 2009. All Rights Reserved.