@Override public boolean matches(Object otherEvent) { if (otherEvent instanceof PatientEvent) { PatientEvent otherPatientEvent = (PatientEvent) otherEvent; if (!StringUtils.equals(otherPatientEvent.getEventType(), this.eventType)) { return false; } return this.patient == null || this.patient.getDocument() == null || (otherPatientEvent.getPatient() != null && this.patient.getDocument().equals( otherPatientEvent.getPatient().getDocument())); } return false; }
@Override public boolean matches(Object otherEvent) { if (otherEvent instanceof PatientEvent) { PatientEvent otherPatientEvent = (PatientEvent) otherEvent; if (!StringUtils.equals(otherPatientEvent.getEventType(), this.eventType)) { return false; } return this.patient == null || this.patient.getDocumentReference() == null || (otherPatientEvent.getPatient() != null && this.patient.getDocumentReference().equals( otherPatientEvent.getPatient().getDocumentReference())); } return false; }