Class NumericRangeConstraint
- java.lang.Object
-
- org.alfresco.repo.dictionary.constraint.AbstractConstraint
-
- org.alfresco.repo.dictionary.constraint.NumericRangeConstraint
-
- All Implemented Interfaces:
Constraint
public class NumericRangeConstraint extends AbstractConstraint
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'sminimum valueormaximum valueare assumed.- Author:
- Derek Hulley
- See Also:
setMinValue(double),setMaxValue(double),Double.parseDouble(java.lang.String)
-
-
Field Summary
-
Fields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET
-
-
Constructor Summary
Constructors Constructor Description NumericRangeConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidevaluateSingleValue(Object value)Support for evaluation of properties.doublegetMaxValue()doublegetMinValue()Map<String,Object>getParameters()Returns the parameters passed to the instance of the constraint.StringgetType()Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.voidsetMaxValue(double maxValue)Set the maximum value allowed, which can be any value betweenDouble.MIN_VALUEandDouble.MAX_VALUE.voidsetMinValue(double minValue)Set the minimum value allowed, which can be any value betweenDouble.MIN_VALUEandDouble.MAX_VALUE.StringtoString()-
Methods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, initialize, set_shortName, setRegistry, setShortName, setTitle
-
-
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:ConstraintReturns the 'type' of the constraint, this is the identifier given to constraint in the configuration.- Specified by:
getTypein interfaceConstraint- Overrides:
getTypein classAbstractConstraint- Returns:
- The type
-
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_VALUEandDouble.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_VALUEandDouble.MAX_VALUE.- Parameters:
maxValue- the minimum value allowed by the constraint
-
getParameters
public Map<String,Object> getParameters()
Description copied from interface:ConstraintReturns the parameters passed to the instance of the constraint.- Specified by:
getParametersin interfaceConstraint- Overrides:
getParametersin classAbstractConstraint- Returns:
- Map of parameters or an empty Map if none exist
-
evaluateSingleValue
protected void evaluateSingleValue(Object value)
Description copied from class:AbstractConstraintSupport for evaluation of properties. The value passed in will never be a Collection and will never be null.- Specified by:
evaluateSingleValuein classAbstractConstraint
-
-