use of com.netflix.exhibitor.core.entities.UITabSpec in project exhibitor by soabase.
the class UIResource method getAdditionalTabSpecs.
@Path("tabs")
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getAdditionalTabSpecs() {
final AtomicInteger index = new AtomicInteger(0);
List<UITabSpec> names = Lists.transform(tabs, new Function<UITab, UITabSpec>() {
@Override
public UITabSpec apply(UITab tab) {
String base = tab.contentIsHtml() ? HTML_UI_TAB_BASE_URL : TEXT_UI_TAB_BASE_URL;
return new UITabSpec(tab.getName(), base + index.getAndIncrement(), tab.contentIsHtml(), tab.getUITabType());
}
});
// move out of Google's TransformingRandomAccessList
names = Lists.newArrayList(names);
GenericEntity<List<UITabSpec>> entity = new GenericEntity<List<UITabSpec>>(names) {
};
return Response.ok(entity).build();
}
Aggregations