1 18 19 package sync4j.syncclient.sps; 20 21 38 public final class Record { 39 40 43 private static final String FIELD_SEPARATOR = "|"; 44 45 private String key = null; 46 47 private char state = ' '; 48 49 private String uid = null; 50 51 54 public Record(String allRecord) { 55 56 this.key = allRecord.substring(0, allRecord.indexOf(FIELD_SEPARATOR)); 57 this.state = allRecord.substring(allRecord.indexOf(FIELD_SEPARATOR) + 1).charAt(0); 58 String tmp = allRecord.substring(allRecord.indexOf(FIELD_SEPARATOR) + 1); 59 this.uid = tmp.substring(tmp.indexOf(FIELD_SEPARATOR) + 1); 60 61 } 62 63 public Record(String key, char state, String uid) { 64 this.key = key; 65 this.state = state; 66 this.uid = uid; 67 } 68 69 public Record(String key, char state) { 70 this.key = key; 71 this.state = state; 72 } 73 74 75 public Record() { 76 77 } 78 79 84 public String getKey() { 85 return this.key; 86 } 87 88 93 public void setKey(String key) { 94 this.key = key; 95 } 96 97 102 public char getState() { 103 return this.state; 104 } 105 106 111 public void setState(char state) { 112 this.state = state; 113 } 114 115 120 public String getUid() { 121 return this.uid; 122 } 123 124 129 public void setUid(String uid) { 130 this.uid = uid; 131 } 132 133 138 public String toString() { 139 return this.key + FIELD_SEPARATOR + String.valueOf(this.state) + FIELD_SEPARATOR + this.uid; 140 } 141 142 } | Popular Tags |