/** * Filter, sort and page results. * * Returns JSON map with resulting destination views and total number of matched destinations * * @param page - defines result page to be returned * @param pageSize - defines page size to be used * @throws IOException */ String filter(int page, int pageSize) throws IOException { ObjectMapper mapper = new ObjectMapper(); destinations = Maps.filterValues(destinations, getPredicate()); Map<ObjectName, DestinationView> pagedDestinations = getPagedDestinations(page, pageSize); Map<String, Object> result = new HashMap<String, Object>(); result.put("data", pagedDestinations); result.put("count", destinations.size()); StringWriter writer = new StringWriter(); mapper.writeValue(writer, result); return writer.toString(); }
/** * Filter, sort and page results. * * Returns JSON map with resulting destination views and total number of matched destinations * * @param page - defines result page to be returned * @param pageSize - defines page size to be used * @throws IOException */ String filter(int page, int pageSize) throws IOException { ObjectMapper mapper = new ObjectMapper(); destinations = Maps.filterValues(destinations, getPredicate()); Map<ObjectName, DestinationView> pagedDestinations = getPagedDestinations(page, pageSize); Map<String, Object> result = new HashMap<String, Object>(); result.put("data", pagedDestinations); result.put("count", destinations.size()); StringWriter writer = new StringWriter(); mapper.writeValue(writer, result); return writer.toString(); }
/** * Filter, sort and page results. * * Returns JSON map with resulting destination views and total number of matched destinations * * @param page - defines result page to be returned * @param pageSize - defines page size to be used * @throws IOException */ String filter(int page, int pageSize) throws IOException { ObjectMapper mapper = new ObjectMapper(); destinations = Maps.filterValues(destinations, getPredicate()); Map<ObjectName, DestinationView> pagedDestinations = getPagedDestinations(page, pageSize); Map<String, Object> result = new HashMap<String, Object>(); result.put("data", pagedDestinations); result.put("count", destinations.size()); StringWriter writer = new StringWriter(); mapper.writeValue(writer, result); return writer.toString(); }
/** * Filter, sort and page results. * * Returns JSON map with resulting destination views and total number of matched destinations * * @param page - defines result page to be returned * @param pageSize - defines page size to be used * @throws IOException */ String filter(int page, int pageSize) throws IOException { ObjectMapper mapper = new ObjectMapper(); destinations = Maps.filterValues(destinations, getPredicate()); Map<ObjectName, DestinationView> pagedDestinations = getPagedDestinations(page, pageSize); Map<String, Object> result = new HashMap<String, Object>(); result.put("data", pagedDestinations); result.put("count", destinations.size()); StringWriter writer = new StringWriter(); mapper.writeValue(writer, result); return writer.toString(); }