public UserIdNameArrayItem addData(long userId, String userName, int career, int level) { UserIdNameArrayItem item = new UserIdNameArrayItem(); item.setUserId(userId); item.setUserName(userName); item.setCareer(career); item.setLevel(level); list.add(item); return item; }
/** 解码 */ @Override public void decode(Data data) { int size = data.getInt(); for (int i = 0; i < size; i++) { UserIdNameArrayItem item = UserIdNameArrayItem.create(); item.setUserId(data.getLong()); item.setUserName(data.getString()); item.setCareer(data.getInt()); item.setLevel(data.getInt()); list.add(item); } }