public class MaximumCharacterConstraint extends Constraint
Modifier and Type | Field and Description |
---|---|
protected long |
mMaxChar |
static CharacterCounter |
sCounter |
mErrorMessage
Constructor and Description |
---|
MaximumCharacterConstraint(String pErrorMessage,
long pMaxChar)
Creates a new maximum character constraint based on the maximum character value.
|
Modifier and Type | Method and Description |
---|---|
String |
describeError(Object pValue) |
CharacterCounter |
getCounter() |
long |
getMaxChar() |
boolean |
isValid(Object pValue)
Returns
true if the value is null or <= MaxChar value. |
equals, hashCode, toString
public static final CharacterCounter sCounter
protected final long mMaxChar
public MaximumCharacterConstraint(String pErrorMessage, long pMaxChar)
pErrorMessage
- the error massage; can not be null
.pMaxChar
- the maximum number of characters; must be positive.IllegalArgumentException
- if pErrorMessage is null
or pMaxChar is not positive.public final long getMaxChar()
public final boolean isValid(Object pValue)
true
if the value is null
or <= MaxChar value.isValid
in class Constraint
public CharacterCounter getCounter()
public final String describeError(Object pValue)
describeError
in class Constraint
© 1998- 2021 Escenic AS