@Retention(value=RUNTIME) @Target(value=FIELD) public @interface NotEmpty
If you also need the value to be non-blank i.e. not all whitespace then use NotBlank. If you need to enforce a minimum length then use MinLength.
NotBlank
MinLength
Copyright © 2012–2017. All rights reserved.