Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4RzcCS5JCAgcxLz7T
39 lines
2.2 KiB
Plaintext
39 lines
2.2 KiB
Plaintext
== a sample value for each constraint (property: value -> result)
|
|
notNull "" valid
|
|
isNull "" must be null
|
|
notEmpty " " valid
|
|
notEmpty "" must not be empty
|
|
notBlank " " must not be blank
|
|
assertTrue false must be true
|
|
assertFalse true must be false
|
|
size "abcde" size must be between 2 and 4
|
|
min 9 must be greater than or equal to 10
|
|
max 11 must be less than or equal to 10
|
|
decimalMin 0.0 must be greater than 0.0
|
|
decimalMax 100 must be less than or equal to 99.99
|
|
digits 1.234 numeric value out of bounds (<3 digits>.<2 digits> expected)
|
|
positive 0 must be greater than 0
|
|
positiveOrZero -1 must be greater than or equal to 0
|
|
negative 0 must be less than 0
|
|
negativeOrZero 1 must be less than or equal to 0
|
|
past today must be a past date
|
|
pastOrPresent tomorrow must be a date in the past or in the present
|
|
future today must be a future date
|
|
futureOrPresent yesterday must be a date in the present or in the future
|
|
pattern "ABCD" must match "[A-Z]{3}"
|
|
email "not-an-email" must be a well-formed email address
|
|
email "a@b" valid
|
|
email "" valid
|
|
length "abcde" length must be between 2 and 4
|
|
range 6 must be between 1 and 5
|
|
url "ankurm.com" must be a valid URL
|
|
uuid "1234" must be a valid UUID
|
|
creditCard "4111111111111112" invalid credit card number
|
|
unique [a, a] must only contain unique elements
|
|
ip "999.1.1.1" invalid IP address
|
|
|
|
== which constraints reject null? (every other field left null)
|
|
rejects null: notBlank
|
|
rejects null: notEmpty
|
|
rejects null: notNull
|