Class DateTimeReminder

    • Constructor Detail

      • DateTimeReminder

        public DateTimeReminder​(ContributionIdentifier contributionId,
                                ReminderProcessName processName)
        Constructs a new reminder about the given contribution for the system.
        Parameters:
        contributionId - the unique identifier of a contribution.
        processName - the name of the process the reminder MUST perform when triggered.
      • DateTimeReminder

        public DateTimeReminder​(ContributionIdentifier contributionId,
                                User user,
                                ReminderProcessName processName)
        Constructs a new reminder about the specified contribution and for the given user.
        Parameters:
        contributionId - the unique identifier of the contribution.
        user - the user aimed by this reminder.
        processName - the name of the process the reminder MUST perform when triggered.
      • DateTimeReminder

        protected DateTimeReminder()
        Empty constructors for the persistence engine.
    • Method Detail

      • copy

        public Reminder copy()
        Description copied from class: Reminder
        Copies this reminder to another one. This method expects the concrete class extending the Reminder abstract one implements a default constructor as it is used to constructs an empty Reminder instance before setting the attributes. Any concrete reminders should override this method in order to set their specifics attributes.
        Overrides:
        copy in class Reminder
        Returns:
        a copy of this reminder.
      • withText

        public final DateTimeReminder withText​(String text)
        Description copied from class: Reminder
        Sets a text with this reminder. The text will be sent with the notification to the user.
        Overrides:
        withText in class Reminder
        Parameters:
        text - a text to attach with the reminder.
        Returns:
        itself.
      • triggerAt

        public DateTimeReminder triggerAt​(OffsetDateTime dateTime)
        Triggers this reminder at the specified date time. The timezone of the specified date time will be set in the timezone of the user behind this reminder.
        Parameters:
        dateTime - the date time at which this reminder will be triggered once scheduled.
        Returns:
        itself.
      • triggerFrom

        public DateTimeReminder triggerFrom​(String temporalProperty)
        Triggers this reminder from the temporal property of the contribution. The timezone of the computed date time will be set in the timezone of the user behind this reminder.
        Parameters:
        temporalProperty - the temporal property of the contribution.
        Returns:
        itself.
      • getDateTime

        public OffsetDateTime getDateTime()
        Gets the datetime at which the trigger of this reminder is set. The returned datetime is based upon the timezone of the user behind this reminder.
        Returns:
        the datetime of this reminder's trigger.
      • computeTriggeringDate

        protected OffsetDateTime computeTriggeringDate()
        Description copied from class: Reminder
        Computes the date time at which this reminder will be triggered. This method is invoked in Reminder.schedule() in order to plan the trigger of this reminder in the timeline. The triggering datetime is computed from the triggering rule that is specific to the concrete type of this reminder. The timezone of the returned triggering date has to be set with the timezone of the user behind the reminder.
        Overrides:
        computeTriggeringDate in class Reminder
        Returns:
        an OffsetDateTime value.