/** * Create ChatMessage from Hashtable generated by Hessian-decoder * * @param hash Hashtable containing ChatMessage parameters */ public void createFromHashtable(Hashtable<String, Object> hash) { LogUtils.logI("Conversation.createFromHashtable() hash[" + hash.toString() + "]"); Enumeration<String> e = hash.keys(); while (e.hasMoreElements()) { String key = e.nextElement(); Tags tag = Tags.findTag(key); if (tag != null) { setValue(tag, hash.get(key)); } } }
/** * Populate Identity from supplied Hashtable. * * @param hash Hashtable containing identity details. * @return Identity instance. */ public Identity createFromHashtable(Hashtable<String, Object> hash) { Enumeration<String> e = hash.keys(); while (e.hasMoreElements()) { String key = e.nextElement(); Object value = hash.get(key); Tags tag = Tags.findTag(key); if (tag != null) setValue(tag, value); } return this; }
/** * Create Comment from HashTable generated by Hessian-decoder * * @param Hashtable representing Comment Item * @return Comment created from Hashtable */ public static Comment createFromHashtable(Hashtable<String, Object> hash) { Comment comment = new Comment(); Enumeration<String> e = hash.keys(); while (e.hasMoreElements()) { String key = e.nextElement(); Object value = hash.get(key); Tags tag = Tags.findTag(key); comment.setValue(tag, value); } return comment; }
/** * Create ActivityItem from HashTable generated by Hessian-decoder * * @param hash Hashtable representing ActivityItem * @return ActivityItem created from Hashtable */ public static IdentitiesTextResponse createFromHashtable(Hashtable<String, Object> hash) { IdentitiesTextResponse identityListResponse = new IdentitiesTextResponse(); Enumeration<String> e = hash.keys(); while (e.hasMoreElements()) { String key = e.nextElement(); Object value = hash.get(key); // Log.d("Get Identity Text", "createFromHashtable: Key " + key + "value: " + value); Tags tag = Tags.findTag(key); identityListResponse.setValue(tag, value); } return identityListResponse; }