@Test public void getAllNode() { }
public static void getAllNode(IResponsibleView iResponsibleView, ResponseListener<List<Node>> responseListener){ mNodeApi.getAllNode() .compose(RxUtil.io2main()) .map(jsonElements -> { List<Node> nodes = new ArrayList<>(jsonElements.size()); Gson gson = new Gson(); for (JsonElement jsonObject:jsonElements){ nodes.add(gson.fromJson(jsonObject, Node.class)); } return nodes; }) .subscribe(new RxObserver2<>(iResponsibleView, responseListener)); }
NodeService extends BaseService<T> { public static void getAllNode(IResponsibleView iResponsibleView, ResponseListener<List<Node>> responseListener){ mNodeApi.getAllNode() .compose(RxUtil.io2main()) .map(jsonElements -> { List<Node> nodes = new ArrayList<>(jsonElements.size()); Gson gson = new Gson(); for (JsonElement jsonObject:jsonElements){ nodes.add(gson.fromJson(jsonObject, Node.class)); } return nodes; }) .subscribe(new RxObserver2<>(iResponsibleView, responseListener)); } }
NodeService extends BaseService<T> { public static void getAllNode(IResponsibleView iResponsibleView, ResponseListener<List<Node>> responseListener){ mNodeApi.getAllNode() .compose(RxUtil.io2main()) .map(jsonElements -> { List<Node> nodes = new ArrayList<>(jsonElements.size()); Gson gson = new Gson(); for (JsonElement jsonObject:jsonElements){ nodes.add(gson.fromJson(jsonObject, Node.class)); } return nodes; }) .subscribe(new RxObserver2<>(iResponsibleView, responseListener)); } NodeService(IResponsibleView iResponsibleView); }
NodeService extends BaseService<T> { public static void getAllNode(IResponsibleView iResponsibleView, ResponseListener<List<Node>> responseListener){ mNodeApi.getAllNode() .compose(RxUtil.io2main()) .map(jsonElements -> { List<Node> nodes = new ArrayList<>(jsonElements.size()); Gson gson = new Gson(); for (JsonElement jsonObject:jsonElements){ nodes.add(gson.fromJson(jsonObject, Node.class)); } return nodes; }) .subscribe(new RxObserver2<>(iResponsibleView, responseListener)); } NodeService(IResponsibleView iResponsibleView); static void getAllNode(IResponsibleView iResponsibleView,
                                  ResponseListener<List<Node>> responseListener); static void getNodeInfo(IResponsibleView iResponsibleView,
                                   ResponseListener<Node> responseListener,
                                   String name); static void getNodeTopicList(IResponsibleView iResponsibleView,
                                        ResponseListener<List<Topic>> responseListener,
                                        String name,
                                        int page); }
NodeService extends BaseService<T> { public static void getAllNode(IResponsibleView iResponsibleView, ResponseListener<List<Node>> responseListener){ mNodeApi.getAllNode() .compose(RxUtil.io2main()) .map(jsonElements -> { List<Node> nodes = new ArrayList<>(jsonElements.size()); Gson gson = new Gson(); for (JsonElement jsonObject:jsonElements){ nodes.add(gson.fromJson(jsonObject, Node.class)); } return nodes; }) .subscribe(new RxObserver2<>(iResponsibleView, responseListener)); } NodeService(IResponsibleView iResponsibleView); static void getAllNode(IResponsibleView iResponsibleView,
                                  ResponseListener<List<Node>> responseListener); static void getNodeInfo(IResponsibleView iResponsibleView,
                                   ResponseListener<Node> responseListener,
                                   String name); static void getNodeTopicList(IResponsibleView iResponsibleView,
                                        ResponseListener<List<Topic>> responseListener,
                                        String name,
                                        int page);  }