MCPcopy Create free account
hub / github.com/akeranen/the-one / copyFrom

Method copyFrom

core/Message.java:258–272  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

replicateMethod · 0.95

Calls 2

updatePropertyMethod · 0.95
getPropertyMethod · 0.45

Tested by

no test coverage detected