Class NumericRangeConstraint
java.lang.Object
org.alfresco.repo.dictionary.constraint.AbstractConstraint
org.alfresco.repo.dictionary.constraint.NumericRangeConstraint
- All Implemented Interfaces:
Constraint
Constraint implementation that ensures that the value is a numeric value bewteen a given
minimum and maximum value. If a minimum or maximum value are not provided, then the JAVA
Double's
minimum value
or maximum value
are assumed.- Author:
- Derek Hulley
- See Also:
-
Field Summary
Fields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
evaluateSingleValue
(Object value) Support for evaluation of properties.double
double
Returns the parameters passed to the instance of the constraint.getType()
Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.void
setMaxValue
(double maxValue) Set the maximum value allowed, which can be any value betweenDouble.MIN_VALUE
andDouble.MAX_VALUE
.void
setMinValue
(double minValue) Set the minimum value allowed, which can be any value betweenDouble.MIN_VALUE
andDouble.MAX_VALUE
.toString()
Methods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, initialize, set_shortName, setRegistry, setShortName, setTitle
-
Constructor Details
-
NumericRangeConstraint
public NumericRangeConstraint()
-
-
Method Details
-
getType
Description copied from interface:Constraint
Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.- Specified by:
getType
in interfaceConstraint
- Overrides:
getType
in classAbstractConstraint
- Returns:
- The type
-
toString
-
getMinValue
public double getMinValue()- Returns:
- Returns the minimum value allowed by the constraint
-
setMinValue
public void setMinValue(double minValue) Set the minimum value allowed, which can be any value betweenDouble.MIN_VALUE
andDouble.MAX_VALUE
.- Parameters:
minValue
- the minimum value allowed by the constraint
-
getMaxValue
public double getMaxValue()- Returns:
- Returns the minimum value allowed by the constraint
-
setMaxValue
public void setMaxValue(double maxValue) Set the maximum value allowed, which can be any value betweenDouble.MIN_VALUE
andDouble.MAX_VALUE
.- Parameters:
maxValue
- the minimum value allowed by the constraint
-
getParameters
Description copied from interface:Constraint
Returns the parameters passed to the instance of the constraint.- Specified by:
getParameters
in interfaceConstraint
- Overrides:
getParameters
in classAbstractConstraint
- Returns:
- Map of parameters or an empty Map if none exist
-
evaluateSingleValue
Description copied from class:AbstractConstraint
Support for evaluation of properties. The value passed in will never be a Collection and will never be null.- Specified by:
evaluateSingleValue
in classAbstractConstraint
-