Package org.silverpeas.core.calendar
Class CalendarTimeWindow
- java.lang.Object
-
- org.silverpeas.core.calendar.CalendarTimeWindow
-
public class CalendarTimeWindow extends Object
This class represents a window of time within which calendar events can occur. Some constraints can be done to filter the events in the window of time by one or several properties.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CalendarTimeWindow
filter(Consumer<CalendarEventFilter> filterConsumer)
Filters the calendar events occurring in this window of time.LocalDate
getEndDate()
Gets the date at which this window of time ends.List<CalendarEventOccurrence>
getEventOccurrences()
Gets the list of occurrences of events that occur in this window of time, once the filtering applied.List<CalendarEvent>
getEvents()
Gets all the events that have at least one occurrence in this window of time, once the filtering applied.Period
getPeriod()
Gets the temporal period covered by this window of time.LocalDate
getStartDate()
Gets the date at which this window of time starts.
-
-
-
Method Detail
-
filter
public CalendarTimeWindow filter(Consumer<CalendarEventFilter> filterConsumer)
Filters the calendar events occurring in this window of time.- Parameters:
filterConsumer
- a function accepting aCalendarEventFilter
instance to set the different filtering criteria.- Returns:
- itself.
-
getStartDate
public LocalDate getStartDate()
Gets the date at which this window of time starts.- Returns:
- the inclusive start date of this window of time.
-
getEndDate
public LocalDate getEndDate()
Gets the date at which this window of time ends.- Returns:
- the exclusive end date of this window of time.
-
getPeriod
public Period getPeriod()
Gets the temporal period covered by this window of time.- Returns:
- the period covered by this window of time.
-
getEventOccurrences
public List<CalendarEventOccurrence> getEventOccurrences()
Gets the list of occurrences of events that occur in this window of time, once the filtering applied. If no filters were previously defined, then the occurrences of all the events occurring in this window of time will be returned.- Returns:
- a list of event occurrences.
-
getEvents
public List<CalendarEvent> getEvents()
Gets all the events that have at least one occurrence in this window of time, once the filtering applied. If no filters were previously defined, then all the events that occur in this window of time will be returned.- Returns:
- a list of events that occur in this window of time.
-
-