Built-in constraints
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
pick the right standard constraint.
Planned topics
@NotNull(not null),@NotBlank(text with a visible character),@NotEmpty(not empty collection or text).@Size(min, max),@Min,@Max,@Positive,@PositiveOrZero,@DecimalMin.@Pattern(regexp=...),@Email,@Past,@Future.- Constraints on nested objects and elements need
@Validon the field. - Null is treated as valid by most constraints except
@NotNull,@NotBlank,@NotEmpty.
Draft outline details
Demonstration
a table of the constraints with one example field each.
Check your understanding
Which for a required product name?
Show answer
@NotBlank.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.