Class MomentsProperties
java.lang.Object
org.springframework.modulith.moments.support.MomentsProperties
@ConfigurationProperties(prefix="spring.modulith.moments")
public class MomentsProperties
extends Object
Configuration properties for
Moments.- Author:
- Oliver Drotbohm, John Cunliffe
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumThe granularity of events to publish. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription(package private) MomentsProperties.GranularityReturns the configuredMomentsProperties.Granularity.TheLocaleto use when determining week boundaries.getShiftedQuarter(LocalDate reference) Returns theShiftedQuarterfor the given reference date.TheZoneIdto determine times which are attached to the events published.booleanWhether to enable theTimeMachine.(package private) booleanisHourly()Returns whether to create hourly events.(package private) booleanReturns whether to create minutely events.(package private) booleanReturns whether to create per-second events.(package private) MomentsPropertieswithGranularity(MomentsProperties.Granularity granularity) (package private) MomentsPropertieswithLocale(Locale locale) (package private) MomentsPropertieswithZoneId(ZoneId zoneId)
-
Field Details
-
DEFAULTS
-
-
Method Details
-
getZoneId
TheZoneIdto determine times which are attached to the events published. Defaults toZoneOffset.UTC.- Returns:
- will never be null.
-
getLocale
TheLocaleto use when determining week boundaries. Defaults toLocale.getDefault().- Returns:
- will never be null.
-
getGranularity
MomentsProperties.Granularity getGranularity()Returns the configuredMomentsProperties.Granularity.- Returns:
- will never be null.
-
isEnableTimeMachine
public boolean isEnableTimeMachine()Whether to enable theTimeMachine. -
isHourly
boolean isHourly()Returns whether to create hourly events. -
isMinutely
boolean isMinutely()Returns whether to create minutely events. -
isSecondly
boolean isSecondly()Returns whether to create per-second events. -
getShiftedQuarter
Returns theShiftedQuarterfor the given reference date.- Parameters:
reference- must not be null.- Returns:
- will never be null.
-
withGranularity
-
withZoneId
-
withLocale
-