From the course: Java EE: Bean Validation
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Pattern, Boolean, and date constraints introduction
From the course: Java EE: Bean Validation
Pattern, Boolean, and date constraints introduction
- [Instructor] Now I want to move on to the final group of constraints. This group is kind of a miscellaneous group that includes constraints for dates, boolean values, email format, and most interestingly, regular expression patterns. Let's start with the simplest group, the boolean value constraints. They are pretty self-explanatory and are AssertTrue and AssertFalse. They ensure that either a value is true or false. The next group of constraints validate date values. They are Future, FutureOrPresent, Past, and PastOrPresent. Again, these are fairly self-explanatory and constrain the field or property they annotate to being either in the future or past or a combination of the present with either future or past. A use for this will be to constrain on date of birth, which logically must be in the past, or delivery date, which must logically be in the future or in the present. Now the next constraint is clearly very useful, as it ensures that an email conforms to the standard format of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Built-in constraints introduction5m 4s
-
(Locked)
Null constraints introduction2m 4s
-
(Locked)
Null constraints implementation5m 8s
-
(Locked)
Numerical constraints introduction2m 33s
-
(Locked)
Numerical constraints implementation6m 10s
-
(Locked)
Pattern, Boolean, and date constraints introduction2m 4s
-
(Locked)
Pattern, Boolean, and date constraints implementation6m 24s
-
-
-
-
-
-