return clazz.equals(Phone.class);
}
public void validate(Object obj, Errors errors) {
//use regular phone
Phone phone = (Phone) obj;
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "phoneNumber", "phone.required",
new Object[]{phone});
if (!errors.hasErrors()) {
String phoneNumber = phone.getPhoneNumber();
String newString = phoneNumber.replaceAll("\\D", "");
if (newString.length() != 10) {
errors.rejectValue("phoneNumber", "phone.ten_digits_required", null);
}