class MapValueValidator implements ServiceAttributeValidator {

    public boolean validate(Set<String> values) {
        boolean valid = true; //blank or empty values set are valid

        if (!CollectionUtils.isEmpty(values)) {
            for (String value : values) {

                if (!valid) {
                    break;
                }

                if (value.length() > 0) {
                    Matcher m = pattern.matcher(value);
                    valid = m.matches();
                }
            }

        }

        if (valid) {
            valid = MapDuplicateKeyChecker.checkForNoDuplicateKeyInValue(values);
        }

        return valid;
    }

}