KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > context > log > variableinstance > ByteArrayUpdateLog


1 package org.jbpm.context.log.variableinstance;
2
3 import org.jbpm.bytes.ByteArray;
4 import org.jbpm.context.exe.VariableInstance;
5 import org.jbpm.context.log.VariableUpdateLog;
6
7 public class ByteArrayUpdateLog extends VariableUpdateLog {
8   
9   private static final long serialVersionUID = 1L;
10   
11   ByteArray oldValue = null;
12   ByteArray newValue = null;
13
14   public ByteArrayUpdateLog() {
15   }
16
17   public ByteArrayUpdateLog(VariableInstance variableInstance, ByteArray oldValue, ByteArray newValue) {
18     super(variableInstance);
19     this.oldValue = (oldValue!=null ? new ByteArray(oldValue) : null );
20     this.newValue = (newValue!=null ? new ByteArray(newValue) : null );
21   }
22
23   public Object JavaDoc getOldValue() {
24     return oldValue;
25   }
26
27   public Object JavaDoc getNewValue() {
28     return newValue;
29   }
30
31   public String JavaDoc toString() {
32     String JavaDoc toString = null;
33     if ( (oldValue==null)
34          && (newValue==null) ) {
35       toString = variableInstance+" remained null";
36     } else if ( (oldValue!=null)
37                 && (oldValue.equals(newValue) )
38               ) {
39       toString = variableInstance+" unchanged";
40     } else {
41       toString = variableInstance+" binary content differs";
42     }
43     return toString;
44   }
45 }
46
Popular Tags