Class ModelConstraint


  • public class ModelConstraint
    extends Object
    Object representation of validation constraints defined on a model domain object Sample JSON serialization:
     {
       "model": "io.rocketbase.commons.model.User",
          "constraints": {
              "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": ".*"
              }],
              "login": [{
                  "type": "NotNull",
                  "message": "may not be null"
              }, {
                  "type": "Length",
                  "message": "length must be between 8 and 2147483647",
                  "min": 8,
                  "max": 2147483647
              }],
              "firstName": [{
                  "type": "NotBlank",
                  "message": "may not be empty"
              }]
          }
     }
     
    See Also:
    ValidationConstraint