Java Code Examples for org.springframework.samples.petclinic.model.Pet#getType()
The following examples show how to use
org.springframework.samples.petclinic.model.Pet#getType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PetValidator.java From DevOps-for-Web-Development with MIT License | 6 votes |
@Override public void validate(Object obj, Errors errors) { Pet pet = (Pet) obj; String name = pet.getName(); // name validation if (!StringUtils.hasLength(name)) { errors.rejectValue("name", "required", "required"); } // type validation if (pet.isNew() && pet.getType() == null) { errors.rejectValue("type", "required", "required"); } // birth date validation if (pet.getBirthDate() == null) { errors.rejectValue("birthDate", "required", "required"); } }
Example 2
Source File: PetValidator.java From DevOps-for-Web-Development with MIT License | 6 votes |
@Override public void validate(Object obj, Errors errors) { Pet pet = (Pet) obj; String name = pet.getName(); // name validation if (!StringUtils.hasLength(name)) { errors.rejectValue("name", REQUIRED, REQUIRED); } // type validation if (pet.isNew() && pet.getType() == null) { errors.rejectValue("type", REQUIRED, REQUIRED); } // birth date validation if (pet.getBirthDate() == null) { errors.rejectValue("birthDate", REQUIRED, REQUIRED); } }
Example 3
Source File: PetValidator.java From docker-workflow-plugin with MIT License | 6 votes |
public void validate(Pet pet, Errors errors) { String name = pet.getName(); // name validaation if (!StringUtils.hasLength(name)) { errors.rejectValue("name", "required", "required"); } else if (pet.isNew() && pet.getOwner().getPet(name, true) != null) { errors.rejectValue("name", "duplicate", "already exists"); } // type valication if (pet.isNew() && pet.getType() == null) { errors.rejectValue("type", "required", "required"); } // type valication if (pet.getBirthDate()==null) { errors.rejectValue("birthDate", "required", "required"); } }
Example 4
Source File: PetValidator.java From audit4j-demo with Apache License 2.0 | 6 votes |
public void validate(Pet pet, Errors errors) { String name = pet.getName(); // name validaation if (!StringUtils.hasLength(name)) { errors.rejectValue("name", "required", "required"); } else if (pet.isNew() && pet.getOwner().getPet(name, true) != null) { errors.rejectValue("name", "duplicate", "already exists"); } // type valication if (pet.isNew() && pet.getType() == null) { errors.rejectValue("type", "required", "required"); } // type valication if (pet.getBirthDate()==null) { errors.rejectValue("birthDate", "required", "required"); } }