Class ValidationConstraint
java.lang.Object
io.rocketbase.commons.dto.validation.ValidationConstraint
Object representation of validation constraints.
Sample JSON serialization:
"lastName": [{
"type": "NotBlank",
"message": "may not be empty"
}],
"email": [{
"type": "NotNull",
"message": "may not be null"
}, {
"type": "Email",
"message": "not a well-formed email address",
"flags": [],
"regexp": ".*"
}]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String attrKey, Object attribute) Add attribute to the current constraint definition.voidsetAttributes(Map<String, Object> attributes)
-
Constructor Details
-
ValidationConstraint
public ValidationConstraint()
-
-
Method Details
-
getAttributes
-
setAttributes
-
addAttribute
Add attribute to the current constraint definition.- Parameters:
attrKey- attribute key identifierattribute- attribute value- Returns:
- the previous value associated with attrKey, or null if there was no mapping for attrKey.
-