Package passport.domain.contexts.events
Class AvailableEventsListing
java.lang.Object
passport.domain.contexts.events.AvailableEventsListing
-
Constructor Summary
ConstructorDescriptionAvailableEventsListing
(Events events) Constructor with the specified events repository. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the list of available events starting from the set date.beingToday
(LocalDate today) Sets the current date for the context.Sets the filter by exact name.intoInterval
(LocalDate startDate, LocalDate endDate) Sets the filter by date range.Sets the sorter by date.Sets the sorter by name.withCategory
(EventCategory category) Sets the filter by category.Sets the filter by date.
-
Constructor Details
-
AvailableEventsListing
Constructor with the specified events repository.- Parameters:
events
- the repository of events used for listing
-
-
Method Details
-
beingToday
Sets the current date for the context.- Parameters:
today
- the current date- Returns:
- the updated AvailableEventsListing object
-
including
Sets the filter by exact name.- Parameters:
sample
- the name to filter by- Returns:
- the updated AvailableEventsListing object
-
withCategory
Sets the filter by category.- Parameters:
category
- the category to filter by- Returns:
- the updated AvailableEventsListing object
-
withDate
Sets the filter by date.- Parameters:
date
- the date to filter by- Returns:
- the updated AvailableEventsListing object
-
intoInterval
Sets the filter by date range.- Parameters:
startDate
- the start date of the rangeendDate
- the end date of the range- Returns:
- the updated AvailableEventsListing object
-
sortedByTitle
Sets the sorter by name.- Returns:
- the updated AvailableEventsListing object
-
sortedByDate
Sets the sorter by date.- Returns:
- the updated AvailableEventsListing object
-
availables
Retrieves the list of available events starting from the set date.- Returns:
- a list of available events
- Throws:
NullPointerException
- if the current date or events repository is not set
-