@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractElement<?, ?> entity = (AbstractElement<?, ?>) o; return path.equals(entity.path); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractElement entity = (AbstractElement) o; return path.equals(entity.path); }
private boolean processDeletion(ProcessingTree<BE> changesTree, List<Notification<?, ?>> ns) { DBG.debugf("Checking for deletion of entity %s", changesTree.cp); Optional<Notification<?, ?>> deleteNotification = ns.stream() .filter(n -> n.getAction() == Action.deleted() && n.getValue() instanceof AbstractElement) .filter(n -> ((AbstractElement<?, ?>) n.getValue()).getPath().equals(changesTree.cp)) .findAny(); if (deleteNotification.isPresent()) { DBG.debugf("Processing deletion of the entity %s", changesTree.cp); //just emit what the caller wanted and don't bother any longer Notification<?, ?> n = deleteNotification.get(); correctedChanges.add(new EntityAndPendingNotifications<BE, AbstractElement<?, ?>>( null, (AbstractElement<?, ?>) n.getValue(), ns)); changesTree.dfsTraversal(pt -> { correctChanges(pt, false); return true; }); DBG.debugf("Done processing deletion of entity %s", changesTree.cp); return true; } DBG.debugf("No delete notifications found for entity %s", changesTree.cp); return false; }
@SuppressWarnings({"unchecked", "rawtypes"}) private Notification<?, ?> cloneWithNewEntity(Notification<?, ?> notif, AbstractElement<?, ?> element) { if (!(notif.getValue() instanceof AbstractElement)) { return notif; } Object context = notif.getActionContext(); Object value = notif.getValue(); if (context instanceof AbstractElement && element.getPath().equals(((AbstractElement) context).getPath())) { context = element; } if (element.getPath().equals(((AbstractElement) value).getPath())) { value = element; } return new Notification(context, value, notif.getAction()); }
if (!ns.getEntity().getPath().equals(entity.getPath())) { continue;