List of usage examples for org.apache.commons.beanutils Person equals
public boolean equals(Object obj)
From source file:org.fenixedu.academic.domain.Professorship.java
@Atomic public static Professorship create(Boolean responsibleFor, ExecutionCourse executionCourse, Person person) { Objects.requireNonNull(responsibleFor); Objects.requireNonNull(executionCourse); Objects.requireNonNull(person); if (executionCourse.getProfessorshipsSet().stream().anyMatch(p -> person.equals(p.getPerson()))) { throw new DomainException("error.teacher.already.associated.to.professorship"); }// w ww . j a v a 2 s . c o m Professorship professorShip = new Professorship(); professorShip.setExecutionCourse(executionCourse); professorShip.setPerson(person); professorShip.setCreator(Authenticate.getUser().getPerson()); professorShip.setResponsibleFor(responsibleFor); if (person.getTeacher() != null) { executionCourse.moveSummariesFromTeacherToProfessorship(person.getTeacher(), professorShip); } ProfessorshipManagementLog.createLog(professorShip.getExecutionCourse(), Bundle.MESSAGING, "log.executionCourse.professorship.added", professorShip.getPerson().getPresentationName(), professorShip.getExecutionCourse().getNome(), professorShip.getExecutionCourse().getDegreePresentationString()); return professorShip; }