Ejemplo n.º 1
0
  @Override
  public List<Event> getEventsByDay(Date day, int pageSize, int pageNum) {
    final List<Event> resultEvents =
        inMemoryStorage
            .getAllEvents()
            .stream()
            .filter(event -> event.getDate().equals(day))
            .collect(Collectors.toList());

    return (List<Event>) DaoUtil.getPage(pageSize, pageNum, resultEvents);
  }
Ejemplo n.º 2
0
  @Override
  public List<Event> getEventsByTitle(String title, int pageSize, int pageNum) {
    final List<Event> resultEvents =
        inMemoryStorage
            .getAllEvents()
            .stream()
            .filter(event -> StringUtils.containsIgnoreCase(event.getTitle(), title))
            .collect(Collectors.toList());

    return (List<Event>) DaoUtil.getPage(pageSize, pageNum, resultEvents);
  }