public void addUser(String name, String address, String peerID, int i) { UserInfo info = new UserInfo(); info.setAddress(address.trim()); info.setPeerID(peerID); info.setName(name); info.setStatus(i); if (chUsers.containsKey(address.trim())) chUsers.remove(address); chUsers.put(address.trim(), info); }
private UserInfo mkUserInfo(Element user) { UserInfo info = new UserInfo(); String name = user.getChildText("name"); String address = user.getChildText("email"); String peerid = user.getChildText("peerid"); String status = user.getChildText("status"); if (status == null) status = "0"; info.setAddress(address); info.setPeerID(peerid); info.setName(name); info.setStatus(Integer.parseInt(status)); return info; }