public class EnumeratedListConstraint extends ConstraintObject
EnumeratedListConstraint implements
the constraint defined by a list of allowed values.
Integer, long, big decimal, big integer, string, and date entities
can be constrained by an enumerated list constraint.
The standard way to create an EnumeratedListConstraint
instance is to use the
method ConstraintObject.createConstraintFromString(String)
with a string representation of an enumerated list constraint.
ConstraintObject.MetaCharcompatibilityTable, 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 and Description |
|---|
EnumeratedListConstraint()
Builds an empty enumerated list constraint.
|
EnumeratedListConstraint(java.util.List<?> v)
Builds an enumerated list constraint.
|
EnumeratedListConstraint(java.lang.Object[] items)
Builds an enumerated list constraint.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getInitializationString()
Returns the initialization string.
|
java.util.List<java.lang.Object> |
getObjects()
Returns the list of objects for enumerated list constraint.
|
boolean |
isBigIntegerConstraint()
Returns big integer status of the enumerated list constraint.
|
boolean |
isBooleanConstraint()
Returns boolean status of the enumerated list constraint.
|
boolean |
isDateConstraint()
Returns date status of the enumerated list constraint.
|
boolean |
isDecimalConstraint()
Returns decimal status of the enumerated list constraint.
|
boolean |
isIntegerConstraint()
Returns integer status of the enumerated list constraint.
|
boolean |
isLongConstraint()
Returns long status of the enumerated list constraint.
|
boolean |
isStringConstraint()
Returns string status of the enumerated list constraint.
|
boolean |
isValidValue(java.lang.Object value)
Tests if the value checks the enumerated list constraint.
|
void |
setInitializationString(java.lang.String initializationString)
Sets the initialization string.
|
void |
setObjects(java.util.List objects)
Sets the list of objects for enumerated list constraint.
|
java.lang.String |
toString()
Returns
true the string that represents the constraint. |
createConstraintFromString, equals, escapeMetaChar, getAllowedConstraintTypes, getConstraintSubType, getConstraintType, hashCode, isEscapedChar, parseConstraintSubType, unescapeMetaChar, unescapeSeparatorCharpublic EnumeratedListConstraint()
public EnumeratedListConstraint(java.lang.Object[] items)
items - the array of enumerated objectspublic EnumeratedListConstraint(java.util.List<?> v)
v - the list of enumerated objectspublic java.lang.String getInitializationString()
getInitializationString in class ConstraintObjectpublic void setInitializationString(java.lang.String initializationString)
initializationString - The initialization stringpublic java.util.List<java.lang.Object> getObjects()
public void setObjects(java.util.List objects)
objects - The list of objectspublic boolean isValidValue(java.lang.Object value)
isValidValue in class ConstraintObjectvalue - the value to checktrue if the value checks the enumerated list constraint,
false otherwisepublic java.lang.String toString()
true the string that represents the constraint.toString in class ConstraintObjectpublic boolean isLongConstraint()
isLongConstraint in class ConstraintObjecttrue if all enumerated values are longs, false otherwisepublic boolean isBigIntegerConstraint()
isBigIntegerConstraint in class ConstraintObjecttrue if all enumerated values are big integers, false otherwisepublic boolean isIntegerConstraint()
isIntegerConstraint in class ConstraintObjecttrue if all enumerated values are integers, false otherwisepublic boolean isDecimalConstraint()
isDecimalConstraint in class ConstraintObjecttrue if all enumerated values are big decimals, false otherwisepublic boolean isDateConstraint()
isDateConstraint in class ConstraintObjecttrue if all enumerated values are dates, false otherwisepublic boolean isStringConstraint()
isStringConstraint in class ConstraintObjecttrue if all enumerated values are strings, false otherwisepublic boolean isBooleanConstraint()
isBooleanConstraint in class ConstraintObjectfalse in any case