public class DoubleConstraint extends RequiredIfConstraint
The Constraint
class represents a single data constraint,
including the data type, allowed values, and required ranges.
Constructor and Description |
---|
DoubleConstraint(java.lang.String identifierIn)
This will create a new
Constraints with the specified
identifier as the "name". |
Modifier and Type | Method and Description |
---|---|
ValidatorError |
checkConstraint(java.lang.Object value)
Check the field against this Constraint to see
if it is in a valid state.
|
java.lang.Double |
getMaxInclusive()
This will return the maximum allowed value for this data type (inclusive).
|
java.lang.Double |
getMinInclusive()
This will return the minimum allowed value for this data type (inclusive).
|
void |
setMaxInclusive(java.lang.Double maxInclusiveIn)
This will set the maximum allowed value for this data type (inclusive).
|
void |
setMinInclusive(java.lang.Double minInclusiveIn)
This will set the minimum allowed value for this data type (inclusive).
|
addField, isRequired
getASCII, getDataType, getIdentifier, getOptional, getPosix, getUserName, isPosix, isValidUserName, setASCII, setDataType, setOptional, setPosix, setUserName, toString
public DoubleConstraint(java.lang.String identifierIn)
This will create a new Constraints
with the specified
identifier as the "name".
identifierIn
- String
identifier for Constraint
.public ValidatorError checkConstraint(java.lang.Object value)
checkConstraint
in interface Constraint
checkConstraint
in class ParsedConstraint
value
- the value to checkpublic void setMinInclusive(java.lang.Double minInclusiveIn)
This will set the minimum allowed value for this data type (inclusive).
minInclusiveIn
- minimum allowed value (inclusive)public java.lang.Double getMinInclusive()
This will return the minimum allowed value for this data type (inclusive).
Double
- minimum value allowed (inclusive)public void setMaxInclusive(java.lang.Double maxInclusiveIn)
This will set the maximum allowed value for this data type (inclusive).
maxInclusiveIn
- maximum allowed value (inclusive)public java.lang.Double getMaxInclusive()
This will return the maximum allowed value for this data type (inclusive).
Double
- maximum value allowed (inclusive)