I didn't put too much effort on validations. But there is no existing annotation allowing you to accept empty string or digits. Pattern is the only one. I just picked 5 thought it's large enough. Now I am trying to make 0 works as max int.