|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiweekly.component.ICalComponent
biweekly.component.VAlarm
public class VAlarm
Defines a reminder for an event or to-do task. This class contains static factory methods to aid in the construction of valid alarms.
Examples:
//audio alarm Trigger trigger = ... Attachment sound = ... VAlarm audio = VAlarm.audio(trigger, sound); //display alarm Trigger trigger = ... String message = "Meeting at 1pm"; VAlarm display = VAlarm.display(trigger, message); //email alarm Trigger trigger = ... String subject = "Reminder: Meeting at 1pm"; String body = "Team,\n\nThe team meeting scheduled for 1pm is about to start. Snacks will be served!\n\nThanks,\nJohn"; List<String> to = Arrays.asList("janedoe@example.com", "bobsmith@example.com"); VAlarm email = VAlarm.email(trigger, subject, body, to);
Field Summary |
---|
Fields inherited from class biweekly.component.ICalComponent |
---|
components, properties |
Constructor Summary | |
---|---|
VAlarm(Action action,
Trigger trigger)
Creates a new alarm. |
Method Summary | |
---|---|
void |
addAttachment(Attachment attachment)
Adds an attachment to the alarm. |
void |
addAttendee(Attendee attendee)
Adds a person who will be emailed when the alarm fires (only applicable for EMAIL alarms). |
static VAlarm |
audio(Trigger trigger)
Creates an audio alarm. |
static VAlarm |
audio(Trigger trigger,
Attachment sound)
Creates an audio alarm. |
static VAlarm |
display(Trigger trigger,
String displayText)
Creates a display alarm. |
static VAlarm |
email(Trigger trigger,
String subject,
String body,
List<String> recipients)
Creates an email alarm. |
static VAlarm |
email(Trigger trigger,
String subject,
String body,
String... recipients)
Creates an email alarm. |
Action |
getAction()
Gets the type of action to invoke when the alarm is triggered. |
List<Attachment> |
getAttachments()
Gets any attachments that are associated with the alarm. |
List<Attendee> |
getAttendees()
Gets the people who will be emailed when the alarm fires (only applicable for EMAIL alarms). |
Description |
getDescription()
Gets a detailed description of the alarm. |
DurationProperty |
getDuration()
Gets the length of the pause between alarm repetitions. |
Repeat |
getRepeat()
Gets the number of times an alarm should be repeated after its initial trigger. |
Summary |
getSummary()
Gets the summary of the alarm. |
Trigger |
getTrigger()
Gets when the alarm will be triggered. |
void |
setAction(Action action)
Sets the type of action to invoke when the alarm is triggered. |
void |
setDescription(Description description)
Sets a detailed description of the alarm. |
Description |
setDescription(String description)
Sets a detailed description of the alarm. |
DurationProperty |
setDuration(Duration duration)
Sets the length of the pause between alarm repetitions. |
void |
setDuration(DurationProperty duration)
Sets the length of the pause between alarm repetitions. |
void |
setRepeat(int count,
Duration pauseDuration)
Sets the repetition information for the alarm. |
Repeat |
setRepeat(Integer count)
Sets the number of times an alarm should be repeated after its initial trigger. |
void |
setRepeat(Repeat repeat)
Sets the number of times an alarm should be repeated after its initial trigger. |
Summary |
setSummary(String summary)
Sets the summary of the alarm. |
void |
setSummary(Summary summary)
Sets the summary of the alarm. |
void |
setTrigger(Trigger trigger)
Sets when the alarm will be triggered. |
protected void |
validate(List<ICalComponent> components,
List<String> warnings)
Checks the component for data consistency problems or deviations from the spec. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VAlarm(Action action, Trigger trigger)
action
- the alarm action (e.g. "email")trigger
- the triggerMethod Detail |
---|
public static VAlarm audio(Trigger trigger)
trigger
- the trigger
public static VAlarm audio(Trigger trigger, Attachment sound)
trigger
- the triggersound
- a sound to play when the alarm triggers
public static VAlarm display(Trigger trigger, String displayText)
trigger
- the triggerdisplayText
- the display text
public static VAlarm email(Trigger trigger, String subject, String body, String... recipients)
trigger
- the triggersubject
- the email subjectbody
- the email bodyrecipients
- the email address(es) to send the alert to
public static VAlarm email(Trigger trigger, String subject, String body, List<String> recipients)
trigger
- the triggersubject
- the email subjectbody
- the email bodyrecipients
- the email address(es) to send the alert to
public List<Attachment> getAttachments()
public void addAttachment(Attachment attachment)
attachment
- the attachment to addpublic Description getDescription()
Gets a detailed description of the alarm. The description should be more
detailed than the one provided by the Summary
property.
This property has different meanings, depending on the alarm action:
public void setDescription(Description description)
Sets a detailed description of the alarm. The description should be more
detailed than the one provided by the Summary
property.
This property has different meanings, depending on the alarm action:
description
- the description or null to removepublic Description setDescription(String description)
Sets a detailed description of the alarm. The description should be more
detailed than the one provided by the Summary
property.
This property has different meanings, depending on the alarm action:
description
- the description or null to remove
public Summary getSummary()
Gets the summary of the alarm.
This property has different meanings, depending on the alarm action:
public void setSummary(Summary summary)
Sets the summary of the alarm.
This property has different meanings, depending on the alarm action:
summary
- the summary or null to removepublic Summary setSummary(String summary)
Sets the summary of the alarm.
This property has different meanings, depending on the alarm action:
summary
- the summary or null to remove
public List<Attendee> getAttendees()
public void addAttendee(Attendee attendee)
attendee
- the email recipientpublic Action getAction()
public void setAction(Action action)
action
- the action or null to removepublic DurationProperty getDuration()
public void setDuration(DurationProperty duration)
duration
- the duration or null to removepublic DurationProperty setDuration(Duration duration)
duration
- the duration or null to remove
public Repeat getRepeat()
public void setRepeat(Repeat repeat)
repeat
- the repeat count or null to removepublic Repeat setRepeat(Integer count)
count
- the repeat count (e.g. "2" to repeat it two more times after
it was initially triggered, for a total of three times) or null to remove
public void setRepeat(int count, Duration pauseDuration)
count
- the repeat count (e.g. "2" to repeat it two more times after
it was initially triggered, for a total of three times)pauseDuration
- the length of the pause between repeatspublic Trigger getTrigger()
public void setTrigger(Trigger trigger)
trigger
- the trigger time or null to removeprotected void validate(List<ICalComponent> components, List<String> warnings)
ICalComponent
validate
in class ICalComponent
components
- the hierarchy of components that the component belongs
towarnings
- the list to add the warnings to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |