@Test public void testRenderWebcasts() { List<WebcastListElement> elements = mRenderer.renderWebcasts(mEvent); assertNotNull(elements); assertEquals(elements.size(), 1); WebcastListElement webcast = elements.get(0); assertNotNull(webcast); assertEquals(webcast.eventKey, EVENT_KEY); assertEquals(webcast.eventName, "New York Tech Valley"); assertEquals(webcast.webcast, JSONHelper.getasJsonArray(mEvent.getWebcasts()).get(0)); assertEquals(webcast.number, 1); }
@WorkerThread public List<WebcastListElement> renderWebcasts(Event event) { List<WebcastListElement> webcasts = new ArrayList<>(); JsonArray webcastJson = JSONHelper.getasJsonArray(event.getWebcasts()); JsonElement webcast; for (int i = 1; i <= webcastJson.size(); i++) { webcast = webcastJson.get(i - 1); webcasts.add(new WebcastListElement(event.getKey(), event.getShortName(), webcast.getAsJsonObject(), i)); } return webcasts; }
EventRenderer implements ModelRenderer<Event, Boolean> { @WorkerThread public List<WebcastListElement> renderWebcasts(Event event) { List<WebcastListElement> webcasts = new ArrayList<>(); JsonArray webcastJson = JSONHelper.getasJsonArray(event.getWebcasts()); JsonElement webcast; for (int i = 1; i <= webcastJson.size(); i++) { webcast = webcastJson.get(i - 1); webcasts.add(new WebcastListElement(event.getKey(), event.getShortName(), webcast.getAsJsonObject(), i)); } return webcasts; } }
EventRenderer implements ModelRenderer<Event, Boolean> { @WorkerThread public List<WebcastListElement> renderWebcasts(Event event) { List<WebcastListElement> webcasts = new ArrayList<>(); JsonArray webcastJson = JSONHelper.getasJsonArray(event.getWebcasts()); JsonElement webcast; for (int i = 1; i <= webcastJson.size(); i++) { webcast = webcastJson.get(i - 1); webcasts.add(new WebcastListElement(event.getKey(), event.getShortName(), webcast.getAsJsonObject(), i)); } return webcasts; } @Inject  EventRenderer(APICache datafeed); }
EventRenderer implements ModelRenderer<Event, Boolean> { @WorkerThread public List<WebcastListElement> renderWebcasts(Event event) { List<WebcastListElement> webcasts = new ArrayList<>(); JsonArray webcastJson = JSONHelper.getasJsonArray(event.getWebcasts()); JsonElement webcast; for (int i = 1; i <= webcastJson.size(); i++) { webcast = webcastJson.get(i - 1); webcasts.add(new WebcastListElement(event.getKey(), event.getShortName(), webcast.getAsJsonObject(), i)); } return webcasts; } @Inject  EventRenderer(APICache datafeed); @WorkerThread @Override @Nullable EventListElement renderFromKey(String key, ModelType type, Boolean args); @WorkerThread @Override @Nullable EventListElement renderFromModel(Event event, Boolean showMyTbaSettings); @WorkerThread List<WebcastListElement> renderWebcasts(Event event); @WorkerThread void renderAlliances(List<EventAlliance> alliances, List<ListItem> destList); }
EventRenderer implements ModelRenderer<Event, Boolean> { @WorkerThread public List<WebcastListElement> renderWebcasts(Event event) { List<WebcastListElement> webcasts = new ArrayList<>(); JsonArray webcastJson = JSONHelper.getasJsonArray(event.getWebcasts()); JsonElement webcast; for (int i = 1; i <= webcastJson.size(); i++) { webcast = webcastJson.get(i - 1); webcasts.add(new WebcastListElement(event.getKey(), event.getShortName(), webcast.getAsJsonObject(), i)); } return webcasts; } @Inject  EventRenderer(APICache datafeed); @WorkerThread @Override @Nullable EventListElement renderFromKey(String key, ModelType type, Boolean args); @WorkerThread @Override @Nullable EventListElement renderFromModel(Event event, Boolean showMyTbaSettings); @WorkerThread List<WebcastListElement> renderWebcasts(Event event); @WorkerThread void renderAlliances(List<EventAlliance> alliances, List<ListItem> destList);  }