Class Reminder.ReminderBuilder

  • Enclosing class:
    Reminder

    public static class Reminder.ReminderBuilder
    extends Object
    A builder of reminders. It builds the concrete reminder according to the type of triggering.
    • Constructor Detail

      • ReminderBuilder

        public ReminderBuilder()
    • Method Detail

      • forUser

        public Reminder.ReminderBuilder forUser​(User user)
        The reminders is for the specified user.
        Parameters:
        user - the user aimed by the reminder.
        Returns:
        itself.
      • withText

        public Reminder.ReminderBuilder withText​(String text)
        The reminder is annotated with the specified text.
        Parameters:
        text - the text associated with the reminder.
        Returns:
        itself.
      • triggerBefore

        public DurationReminder triggerBefore​(int duration,
                                              TimeUnit timeUnit,
                                              String temporalProperty,
                                              ReminderProcessName processName)
        Triggers this reminder the specified duration before the given property of the contribution. The property must represents either a date or a date time whose the value is a Temporal object. For example the start date of an event or the end date of the visibility of a publication.
        Parameters:
        duration - the duration value prior to the temporal property of the contribution.
        timeUnit - the time unit in which is expressed the duration.
        temporalProperty - the temporal property of the contribution.
        processName - the name of the process the reminder MUST perform when triggered.
        Returns:
        a DurationReminder instance.
      • triggerFrom

        public DateTimeReminder triggerFrom​(String temporalProperty,
                                            ReminderProcessName processName)
        Triggers the reminder from the temporal property of the contribution.
        Parameters:
        temporalProperty - the temporal property of the contribution.
        processName - the name of the process the reminder MUST perform when triggered.
        Returns:
        a DateTimeReminder instance.