java - Limit the key of a HashMap to a specified length of characters -
i limit size of key hashmap specific size limit.
i tried this:
@valid private map<key, string> views; public class key { @notblank @size(max = 100) private string key;
the problem @valid
not valid key value of hashmap.
what best way limit key specific size of characters?
you can validate number of characters in key field (private string key;) in setter method, if greater maxlimit, throw exception.
Comments
Post a Comment