use of org.apache.karaf.examples.rest.api.Booking in project karaf by apache.
the class ListBookingCommand method execute.
@Override
public Object execute() throws Exception {
List providers = new ArrayList();
providers.add(new JacksonJsonProvider());
WebClient webClient = WebClient.create(restLocation, providers);
List<Booking> bookings = (List<Booking>) webClient.accept(MediaType.APPLICATION_JSON).getCollection(Booking.class);
for (Booking booking : bookings) {
System.out.println(booking.getId() + " " + booking.getCustomer() + " " + booking.getFlight());
}
return null;
}
Aggregations