00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.openmobileis.synchro.algo.replication;
00030
00038 public class DefaultSynchroAtomicObject implements SynchroAtomicObject {
00039 static final long serialVersionUID = 5521257935120563452L;
00040
00041 private String uid;
00042 private String checksum;
00043 private long syncnumber;
00044 private short modificationType;
00045 private long creationDate;
00046
00047 public DefaultSynchroAtomicObject(String id, String sum, long syncnumber, short type, long creationdate) {
00048 uid = id;
00049 checksum=sum;
00050 this.syncnumber=syncnumber;
00051 modificationType = type;
00052 creationDate = creationdate;
00053 }
00054 public DefaultSynchroAtomicObject(String id, String sum) {
00055 uid = id;
00056 checksum=sum;
00057 syncnumber=0;
00058 creationDate = 0;
00059 modificationType = SynchroAtomicObject.ADD;
00060 }
00061
00062 public long getCreationDate() {
00063 return creationDate;
00064 }
00065
00066 public String getUID() {
00067 return uid;
00068 }
00069
00070 public String getCheckSum() {
00071 return checksum;
00072 }
00073 public void setCheckSum(String sum) {
00074 checksum = sum;
00075 }
00076
00077 public long getModifSyncNumber() {
00078 return syncnumber;
00079 }
00080 public void setModifSyncNumber(long ts) {
00081 syncnumber = ts;
00082 }
00083
00084 public short getModificationType() {
00085 return modificationType;
00086 }
00087
00088 public void setModificationType(short type) {
00089 modificationType = type;
00090 }
00091
00092 public boolean equals(Object obj) {
00093 if (obj instanceof SynchroAtomicObject) {
00094 if(((SynchroAtomicObject)obj).getUID().equals(uid)) {
00095 return true;
00096 }
00097 }
00098 return false;
00099 }
00100
00101 public int hashCode() {
00102 return uid.hashCode();
00103 }
00104 }