org.springmodules.validation.util.condition.string
Class LengthRangeStringCondition
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.LengthRangeStringCondition
- All Implemented Interfaces:
- Condition
public class LengthRangeStringCondition
- extends AbstractStringCondition
An AbstractStringCondition
implementation that checks that a given string is
within a specific length range.
- Author:
- Uri Boness
Constructor Summary |
LengthRangeStringCondition(int minLength,
int maxLength)
Constructs a new LengthRangeStringCondition with given min and max range boundries. |
Method Summary |
protected boolean |
checkString(String text)
Checks that the given text is within the range defined by this condition. |
int |
getMaxLength()
Returns the maximum length of the range. |
int |
getMinLength()
Returns the minimum length of the range. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthRangeStringCondition
public LengthRangeStringCondition(int minLength,
int maxLength)
- Constructs a new LengthRangeStringCondition with given min and max range boundries.
- Parameters:
minLength
- The minimum length of the text range.maxLength
- The maximum length of the text range.
checkString
protected boolean checkString(String text)
- Checks that the given text is within the range defined by this condition.
- Specified by:
checkString
in class AbstractStringCondition
- Parameters:
text
- The text to be checked.
- Returns:
true
if the given text is within the range, false
otherwise.
getMinLength
public int getMinLength()
- Returns the minimum length of the range.
- Returns:
- The minimum length of the range.
getMaxLength
public int getMaxLength()
- Returns the maximum length of the range.
- Returns:
- The maximum length of the range.
Copyright © 2009. All Rights Reserved.