1 56 package org.objectstyle.cayenne.graph; 57 58 import org.objectstyle.cayenne.util.Util; 59 60 64 class NodePropertyChangeOperation extends NodeDiff { 65 66 String property; 67 Object oldValue; 68 Object newValue; 69 70 NodePropertyChangeOperation(Object nodeId, String property, Object oldValue, 71 Object newValue) { 72 73 super(nodeId); 74 this.property = property; 75 this.oldValue = oldValue; 76 this.newValue = newValue; 77 } 78 79 82 public boolean isNoop() { 83 return Util.nullSafeEquals(oldValue, newValue); 84 } 85 86 public void apply(GraphChangeHandler tracker) { 87 tracker.nodePropertyChanged(nodeId, property, oldValue, newValue); 88 } 89 90 public void undo(GraphChangeHandler tracker) { 91 tracker.nodePropertyChanged(nodeId, property, newValue, oldValue); 92 } 93 } 94 | Popular Tags |