@Test public void match() { DocumentReference alice = new DocumentReference("wiki", "Users", "Alice"); DocumentReference bob = new DocumentReference("wiki", "Users", "Bob"); Assert.assertFalse(new DocumentRolledBackEvent().matches(new DocumentRollingBackEvent())); Assert.assertTrue(new DocumentRolledBackEvent().matches(new DocumentRolledBackEvent())); Assert.assertTrue(new DocumentRolledBackEvent().matches(new DocumentRolledBackEvent(alice, "2.3"))); Assert.assertFalse(new DocumentRolledBackEvent(bob).matches(new DocumentRolledBackEvent(alice, "1.5"))); Assert.assertTrue(new DocumentRolledBackEvent(bob).matches(new DocumentRolledBackEvent(bob, "4.2"))); Assert.assertFalse(new DocumentRolledBackEvent(bob, "3.1").matches(new DocumentRolledBackEvent(bob))); Assert.assertFalse(new DocumentRolledBackEvent(bob, "7.6").matches(new DocumentRolledBackEvent(bob, "7.5"))); Assert.assertTrue(new DocumentRolledBackEvent(bob, "5.8").matches(new DocumentRolledBackEvent(bob, "5.8"))); Assert.assertFalse(new DocumentRolledBackEvent(bob, "1.0").matches(new DocumentRolledBackEvent(alice, "1.0"))); }
@Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRolledBackEvent documentRolledBackEvent = (DocumentRolledBackEvent) otherEvent; matches = revision == null || revision.equals(documentRolledBackEvent.getRevision()); } return matches; }
DocumentRolledBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRolledBackEvent documentRolledBackEvent = (DocumentRolledBackEvent) otherEvent; matches = revision == null || revision.equals(documentRolledBackEvent.getRevision()); } return matches; } }
DocumentRolledBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRolledBackEvent documentRolledBackEvent = (DocumentRolledBackEvent) otherEvent; matches = revision == null || revision.equals(documentRolledBackEvent.getRevision()); } return matches; } DocumentRolledBackEvent();  DocumentRolledBackEvent(DocumentReference documentReference);  DocumentRolledBackEvent(DocumentReference documentReference, String revision);  DocumentRolledBackEvent(EventFilter eventFilter); }
DocumentRolledBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRolledBackEvent documentRolledBackEvent = (DocumentRolledBackEvent) otherEvent; matches = revision == null || revision.equals(documentRolledBackEvent.getRevision()); } return matches; } DocumentRolledBackEvent();  DocumentRolledBackEvent(DocumentReference documentReference);  DocumentRolledBackEvent(DocumentReference documentReference, String revision);  DocumentRolledBackEvent(EventFilter eventFilter); String getRevision(); @Override boolean matches(Object otherEvent); }
DocumentRolledBackEvent extends AbstractDocumentEvent { @Override public boolean matches(Object otherEvent) { boolean matches = super.matches(otherEvent); if (matches) { DocumentRolledBackEvent documentRolledBackEvent = (DocumentRolledBackEvent) otherEvent; matches = revision == null || revision.equals(documentRolledBackEvent.getRevision()); } return matches; } DocumentRolledBackEvent();  DocumentRolledBackEvent(DocumentReference documentReference);  DocumentRolledBackEvent(DocumentReference documentReference, String revision);  DocumentRolledBackEvent(EventFilter eventFilter); String getRevision(); @Override boolean matches(Object otherEvent);  }