API에서 값을 입력받을 때 validation 체크를 위해 사용되는 어노테이션들이다. 차이점에 대해 알아보자.
@NotNull
- The annotated element must not be null. Accepts any type.
- null값만 허용하지 않는다. "", " " 허용한다.
@NotEmpty
- The annotatd element must not be null nor empty.
Supported types are
- null, "" 허용하지 않는다. " "은 허용한다.
@NotBlank
- The annotated element must not be null and must contain at least one non-whitespace character. Accepts CharSequence.
- null, "", " " 모두 허용하지 않는다.