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
ConstructorsConstructorDescriptionMoments(Clock clock, ApplicationEventPublisher events, MomentsProperties properties) -
Method Summary
Modifier and TypeMethodDescription(package private) voidTriggers event publication every hour.(package private) voidTriggers event publication every midnight.instant()Returns the current Instant.now()Returns the current point in time.(package private) Momentstoday()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:NowReturns the current point in time. -
today
Description copied from interface:NowReturns the current date. -
instant
Description copied from interface:NowReturns the current Instant.
-