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. What constitutes a week depends on the Locale
provided.- Author:
- Oliver Drotbohm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the end date of the week that has passed.(package private) LocaleTheLocaleto be used to calculate the start date of the week.Returns the start date of the week that has passed.intgetWeek()The week of the year that has just passed.getYear()The year of the week that has just passed.inthashCode()static WeekHasPassedCreates a newWeekHasPassedfor the givenYearand 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 newWeekHasPassedfor the givenYearand week of the year.- Parameters:
year- must not be null.week- must be between 0 and 53 (inclusive).- Returns:
- will never be null.
-
getYear
The year of the week that has just passed.- Returns:
- will never be null.
-
getWeek
public int getWeek()The week of the year that has just passed.- Returns:
- between 0 and 53 (inclusive).
-
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()TheLocaleto be used to calculate the start date of the week.- Returns:
- will never be null.
-
equals
-
hashCode
public int hashCode()
-