Skip to content

Commit

Permalink
GH-280 - Make MomentsProperties usable on AOT.
Browse files Browse the repository at this point in the history
Introduce a default constructor to prevent the AOT engine from breaking as reported in [0].

[0] spring-projects/spring-framework#31117
  • Loading branch information
odrotbohm committed Aug 26, 2023
1 parent 4d939d3 commit 28fcdf1
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@ConfigurationProperties(prefix = "spring.modulith.moments")
public class MomentsProperties {

public static final MomentsProperties DEFAULTS = new MomentsProperties(null, null, null, (Month) null, false);
public static final MomentsProperties DEFAULTS = new MomentsProperties();

private final Granularity granularity;
private final ZoneId zoneId;
Expand All @@ -49,13 +49,22 @@ public class MomentsProperties {

private final ShiftedQuarters quarters;

/**
* Creates a new {@link MomentsProperties} with default granularity of {@value Granularity#HOURS}, a {@link ZoneId} of
* {@code UTC}, the JVM's default {@link Locale} to determine starts of weeks, an unshifted {@link ShiftedQuarter} and
* not enabling the {@link TimeMachine}.
*/
private MomentsProperties() {
this(null, null, null, (Month) null, false);
}

/**
* Creates a new {@link MomentsProperties} for the given {@link Granularity}, {@link ZoneId}, {@link Locale} and
* quarter start {@link Month}.
*
* @param granularity can be {@literal null}, defaults to {@value Granularity#HOURS}.
* @param zoneId the time zone id to use, defaults to {@code UTC}.
* @param locale
* @param locale the locale to determine starts of weeks.
* @param quarterStartMonth the {@link Month} at which quarters start. Defaults to {@value Month#JANUARY}, resulting
* in {@link ShiftedQuarter}s without any shift.
*/
Expand Down

0 comments on commit 28fcdf1

Please sign in to comment.