Deep copies message data from other message. If new fields are introduced to this class, most likely they should be copied here too (unless done in constructor). @param m The message where the data is copied
(Message m)
| 256 | * @param m The message where the data is copied |
| 257 | */ |
| 258 | protected void copyFrom(Message m) { |
| 259 | this.path = new ArrayList<DTNHost>(m.path); |
| 260 | this.timeCreated = m.timeCreated; |
| 261 | this.responseSize = m.responseSize; |
| 262 | this.requestMsg = m.requestMsg; |
| 263 | this.initTtl = m.initTtl; |
| 264 | this.appID = m.appID; |
| 265 | |
| 266 | if (m.properties != null) { |
| 267 | Set<String> keys = m.properties.keySet(); |
| 268 | for (String key : keys) { |
| 269 | updateProperty(key, m.getProperty(key)); |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Adds a generic property for this message. The key can be any string but |
no test coverage detected