Package com.highdeal.udr.hci
Class RangeConstraint
java.lang.Object
com.highdeal.udr.hci.ConstraintObject
com.highdeal.udr.hci.RangeConstraint
The
RangeConstraint implements
the constraint defined by a range min and a range max.
Integer, long, big decimal, big integer and date entities
can be constrained by a range constraint.
The standard way to create a RangeConstraint instance is to use the
method ConstraintObject.createConstraintFromString(String)
with a string representation of a range constraint.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.highdeal.udr.hci.ConstraintObject
ConstraintObject.MetaChar -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe exclusive type for range constraint.static final intthe inclusive type for range constraint.Fields inherited from class com.highdeal.udr.hci.ConstraintObject
compatibilityTable, NO_SUBTYPE, separator, separatorChar, STRING_TYPE_BIG_INTEGER, STRING_TYPE_BOOLEAN, STRING_TYPE_DATE, STRING_TYPE_DECIMAL, STRING_TYPE_ENUMERATED_LIST, STRING_TYPE_FORMAT, STRING_TYPE_INTEGER, STRING_TYPE_LONG, STRING_TYPE_RANGE, STRING_TYPE_STRING, TYPE_BIG_INTEGER, TYPE_BOOLEAN, TYPE_DATE, TYPE_DECIMAL, TYPE_ENUMERATED_LIST, TYPE_FORMAT, TYPE_INTEGER, TYPE_LONG, TYPE_RANGE, TYPE_STRING -
Constructor Summary
ConstructorsConstructorDescriptionBuilds a range constraint.RangeConstraint(Object rangeMin, int rangeMinType, Object rangeMax, int rangeMaxType) Build a range constraint with minimum and maximum values plus their type (TYPE_INCLUSIVE,TYPE_EXCLUSIVE) -
Method Summary
Modifier and TypeMethodDescriptionReturns the initialization string.Returns the range max of range constraint.intReturns the range max type of range constraint.Returns the range min of range constraint.intReturns the range min type of range constraint.booleanReturns big integer status of the range constraint.booleanReturns boolean status of the range constraint.booleanReturns date status of the range constraint.booleanReturns decimal status of the range constraint.booleanReturns integer status of the range constraint.booleanReturns long status of the range constraint.booleanReturns string status of the range constraint.booleanisValidValue(Object value) Tests if the value checks the range constraint.voidsetInitializationString(String initializationString) Sets the initialization string.voidsetRangeMax(Object rangeMax) Sets the range max of range constraint.voidsetRangeMaxType(int rangeMaxType) Sets the range max type of range constraint.voidsetRangeMin(Object rangeMin) Sets the range min of range constraint.voidsetRangeMinType(int rangeMinType) Sets the range min type of range constraint.toString()Returnsstring representationthat represents the range constraint.Methods inherited from class com.highdeal.udr.hci.ConstraintObject
createConstraintFromString, equals, escapeMetaChar, getAllowedConstraintTypes, getConstraintSubType, getConstraintType, hashCode, isEscapedChar, parseConstraintSubType, unescapeMetaChar, unescapeSeparatorChar
-
Field Details
-
TYPE_INCLUSIVE
public static final int TYPE_INCLUSIVEthe inclusive type for range constraint.- See Also:
-
TYPE_EXCLUSIVE
public static final int TYPE_EXCLUSIVEthe exclusive type for range constraint.- See Also:
-
-
Constructor Details
-
RangeConstraint
public RangeConstraint()Builds a range constraint. -
RangeConstraint
Build a range constraint with minimum and maximum values plus their type (TYPE_INCLUSIVE,TYPE_EXCLUSIVE)- Parameters:
rangeMin- the minimum range valuerangeMinType- the type of minimum range value (TYPE_INCLUSIVE,TYPE_EXCLUSIVE)rangeMax- the maximum range valuerangeMaxType- the type of maximum range value (TYPE_INCLUSIVE,TYPE_EXCLUSIVE)
-
-
Method Details
-
getInitializationString
Returns the initialization string.- Specified by:
getInitializationStringin classConstraintObject- Returns:
- the initialization string.
-
setInitializationString
Sets the initialization string.- Parameters:
initializationString- the initialization string.
-
getRangeMin
Returns the range min of range constraint.- Returns:
- the range min.
-
setRangeMin
Sets the range min of range constraint.- Parameters:
rangeMin- the range Min.
-
getRangeMinType
public int getRangeMinType()Returns the range min type of range constraint.- Returns:
- the range min type.
- See Also:
-
setRangeMinType
public void setRangeMinType(int rangeMinType) Sets the range min type of range constraint.A range min specifies a range type . The allowed types are :
- Parameters:
rangeMinType- the range min type.
-
getRangeMax
Returns the range max of range constraint.- Returns:
- the range max.
-
setRangeMax
Sets the range max of range constraint.- Parameters:
rangeMax- the range Max.
-
getRangeMaxType
public int getRangeMaxType()Returns the range max type of range constraint.- Returns:
- the range max type.
- See Also:
-
setRangeMaxType
public void setRangeMaxType(int rangeMaxType) Sets the range max type of range constraint.A range max specifies a range type . The allowed types are :
- Parameters:
rangeMaxType- the range max type.
-
isValidValue
Tests if the value checks the range constraint.- Specified by:
isValidValuein classConstraintObject- Parameters:
value- the value to check- Returns:
trueif the value checks the range constraint.falseotherwise.
-
toString
Returnsstring representationthat represents the range constraint.- Specified by:
toStringin classConstraintObject- Returns:
- the string representation.
-
isIntegerConstraint
public boolean isIntegerConstraint()Returns integer status of the range constraint.- Specified by:
isIntegerConstraintin classConstraintObject- Returns:
- true if the range limits are integers or null, false otherwise.
-
isLongConstraint
public boolean isLongConstraint()Returns long status of the range constraint.- Specified by:
isLongConstraintin classConstraintObject- Returns:
- true if the range limits are longs or null, false otherwise.
-
isBigIntegerConstraint
public boolean isBigIntegerConstraint()Returns big integer status of the range constraint.- Specified by:
isBigIntegerConstraintin classConstraintObject- Returns:
- true if the range limits are big integers or null, false otherwise.
-
isDecimalConstraint
public boolean isDecimalConstraint()Returns decimal status of the range constraint.- Specified by:
isDecimalConstraintin classConstraintObject- Returns:
- true if the range limits are big decimals or null, false otherwise.
-
isDateConstraint
public boolean isDateConstraint()Returns date status of the range constraint.- Specified by:
isDateConstraintin classConstraintObject- Returns:
- true if the range limits are dates or null, false otherwise.
-
isStringConstraint
public boolean isStringConstraint()Returns string status of the range constraint.- Specified by:
isStringConstraintin classConstraintObject- Returns:
- false in any case.
-
isBooleanConstraint
public boolean isBooleanConstraint()Returns boolean status of the range constraint.- Specified by:
isBooleanConstraintin classConstraintObject- Returns:
- false in any case.
-