Class Moments
java.lang.Object
org.springframework.modulith.moments.support.Moments
- All Implemented Interfaces:
Now
- Direct Known Subclasses:
TimeMachine
Core component to publish passage-of-time events.
- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionMoments
(Clock clock, ApplicationEventPublisher events, MomentsProperties properties) -
Method Summary
Modifier and TypeMethodDescription(package private) void
Triggers event publication every hour.(package private) void
Triggers event publication every midnight.instant()
Returns the current Instant.now()
Returns the current point in time.(package private) Moments
today()
Returns the current date.
-
Constructor Details
-
Moments
- Parameters:
clock
- must not be null.events
- must not be null.properties
- must not be null.
-
-
Method Details
-
everyHour
Triggers event publication every hour. -
everyMidnight
Triggers event publication every midnight. -
shiftBy
-
now
Description copied from interface:Now
Returns the current point in time. -
today
Description copied from interface:Now
Returns the current date. -
instant
Description copied from interface:Now
Returns the current Instant.
-