/** * 把数据层传过来的实体类封装成视图层尸体类(实现数据层和视图层的解耦) * * @param list * @return */ private List<String> getStringListByExampleBeanList(List<ExampleBean> list) { List<String> result = new ArrayList<String>(); for (ExampleBean b : list) { result.add(b.getContent()); } return result; }
@Override public List<ExampleBean> getSynTestData() throws Exception { // TODO Auto-generated method stub List<ExampleBean> list = new ArrayList<ExampleBean>(); ExampleBean bean = new ExampleBean(); bean.setContent("这是同步返回的消息"); list.add(bean); return list; }