Skip to main content
Version: Version 1.2.x

API - Restriction

The Restriction class provides validation constraints for attributes.

Fields​

FieldTypeDescription
minTextLengthIntegerMinimum text length
maxTextLengthIntegerMaximum text length
minLongLongMinimum long value
minDecimalBigDecimalMinimum decimal value
maxLongLongMaximum long value
maxDecimalBigDecimalMaximum decimal value
regexStringRegular expression pattern
descriptionStringRegex description
allowedValuesList<String>Allowed values
emptyBooleanWhether 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();