Class WeekHasPassed

java.lang.Object
org.springframework.modulith.moments.WeekHasPassed
All Implemented Interfaces:
org.jmolecules.event.types.DomainEvent

public class WeekHasPassed extends Object implements 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 Details

    • WeekHasPassed

      WeekHasPassed(Year year, int week, Locale locale)
      Creates a new WeekHasPassed for the given Year, week and Locale.
      Parameters:
      year - must not be null.
      week - must be between 0 and 53 (inclusive).
      locale - must not be null.
  • Method Details

    • of

      public static WeekHasPassed of(Year year, int week, Locale locale)
      Creates a new WeekHasPassed for the given Year, week and Locale.
      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

      public static WeekHasPassed of(Year year, int week)
      Creates a new WeekHasPassed for the given Year and week of the year.
      Parameters:
      year - must not be null.
      week - must not be null.
      Returns:
      will never be null.
    • getYear

      public Year getYear()
      The year of the week that has just passed.
      Returns:
      will never be null.
    • getWeek

      public int getWeek()
      The Locale to be used to calculate the start date of the week.
      Returns:
      will never be null.
    • getStartDate

      public LocalDate getStartDate()
      Returns the start date of the week that has passed.
      Returns:
      will never be null.
    • getEndDate

      public LocalDate 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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object