@NotNull
CharSequence, Collection, Map or Array object cannot be null, however can be empty.
@NotEmpty
The CharSequence, Collection, Map or Array object cannot be null and not empty (size > 0).
@NotBlank
The string is not null and the length is greater than zero.
CharSequence, Collection, Map or Array object cannot be null, however can be empty.
@NotEmpty
The CharSequence, Collection, Map or Array object cannot be null and not empty (size > 0).
@NotBlank
The string is not null and the length is greater than zero.
Here are the examples: String test = null; @NotNull: false @NotEmpty: false @NotBlank: false String test = ""; @NotNull: true @NotEmpty: false @NotBlank: false String test = " "; @NotNull: true @NotEmpty: true @NotBlank: false String name = "Some text"; @NotNull: true @NotEmpty: true @NotBlank: true
Thanks you very much for sharing these links. Will definitely check this out..
ReplyDelete代 寫 cs