Class WeekHasPassed
java.lang.Object
org.springframework.modulith.moments.WeekHasPassed
- All Implemented Interfaces:
org.jmolecules.event.types.DomainEvent
A
DomainEvent
published if a week has passed. The semantics of what constitutes are depended on the
Locale
provided.- Author:
- Oliver Drotbohm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the end date of the week that has passed.(package private) Locale
Returns the start date of the week that has passed.int
getWeek()
TheLocale
to be used to calculate the start date of the week.getYear()
The year of the week that has just passed.int
hashCode()
static WeekHasPassed
Creates a newWeekHasPassed
for the givenYear
and week of the year.static WeekHasPassed
-
Constructor Details
-
WeekHasPassed
- Parameters:
year
- must not be null.week
- must be between 0 and 53 (inclusive).locale
- must not be null.
-
-
Method Details
-
of
- Parameters:
year
- must not be null.week
- must be between 0 and 53 (inclusive).locale
- must not be null.- Returns:
- will never be null.
-
of
Creates a newWeekHasPassed
for the givenYear
and week of the year.- Parameters:
year
- must not be null.week
- must not be null.- Returns:
- will never be null.
-
getYear
The year of the week that has just passed.- Returns:
- will never be null.
-
getWeek
public int getWeek()TheLocale
to be used to calculate the start date of the week.- Returns:
- will never be null.
-
getStartDate
Returns the start date of the week that has passed.- Returns:
- will never be null.
-
getEndDate
Returns the end date of the week that has passed.- Returns:
- will never be null.
-
getLocale
Locale getLocale()- Returns:
- will never be null.
-
equals
-
hashCode
public int hashCode()
-