01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.change.event;
05:
06: import com.tc.object.ObjectID;
07: import com.tc.object.change.TCChangeBufferEvent;
08: import com.tc.object.dna.api.DNAWriter;
09:
10: public class PhysicalChangeEvent implements TCChangeBufferEvent {
11: private final Object newValue;
12: private final String fieldname;
13:
14: public PhysicalChangeEvent(String fieldname, Object newValue) {
15: this .newValue = newValue;
16: this .fieldname = fieldname;
17: }
18:
19: public String getFieldName() {
20: return fieldname;
21: }
22:
23: public Object getNewValue() {
24: return newValue;
25: }
26:
27: public boolean isReference() {
28: return newValue instanceof ObjectID;
29: }
30:
31: public void write(DNAWriter writer) {
32: writer.addPhysicalAction(fieldname, newValue);
33: }
34:
35: }
|