API - Restriction
The Restriction class provides validation constraints for attributes.
Fields
| Field | Type | Description |
|---|---|---|
minTextLength | Integer | Minimum text length |
maxTextLength | Integer | Maximum text length |
minLong | Long | Minimum long value |
minDecimal | BigDecimal | Minimum decimal value |
maxLong | Long | Maximum long value |
maxDecimal | BigDecimal | Maximum decimal value |
regex | String | Regular expression pattern |
description | String | Regex description |
allowedValues | List<String> | Allowed values |
empty | Boolean | Whether restrictions are empty |
Text restrictions
Integer getMinTextLength();
Integer getMaxTextLength();
void setMinTextLength(Integer pMinTextLength) throws DataAccessException;
void setMaxTextLength(Integer pMaxTextLength) throws DataAccessException;
Number restrictions
Long getMinAsLong();
BigDecimal getMinAsDecimal();
Long getMaxAsLong();
BigDecimal getMaxAsDecimal();
void setMinAsLong(Long pMinLong) throws DataAccessException;
void setMinAsDecimal(BigDecimal pMinDecimal) throws DataAccessException;
void setMaxAsLong(Long pMaxLong) throws DataAccessException;
void setMaxAsDecimal(BigDecimal pMaxDecimal) throws DataAccessException;
Regex restrictions
String getRegex();
String getDescription();
void setRegex(String pRegex, String pDescription) throws DataAccessException;
Allowed values for value lists
List<String> getAllowedValues();
void setAllowedValues(String ... pAllowedValues);
void setAllowedValues(Collection<String> pAllowedValues);
Check if restrictions are empty
Boolean isEmpty();