}
return complaintRep.insert(complaint);
}
public void validate(Complaint complaint) {
Functions f = new Functions();
if (complaint == null) {
throw new IllegalArgumentException();
}
f.campoPreenchido(complaint.getDescricao());
if (complaint instanceof AnimalComplaint) {
f.campoPreenchido(((AnimalComplaint) complaint).getOccurenceLocalAddress());
f.campoPreenchido(((AnimalComplaint) complaint).getAnimal());
}
if (complaint instanceof FoodComplaint) {
f.campoPreenchido(((FoodComplaint) complaint).getQtdeComensais());
f.campoPreenchido(((FoodComplaint) complaint).getQtdeDoentes());
}
}