public class Trigger extends ICalProperty
Defines when to trigger an alarm.
Code sample:
//15 minutes before the start time Duration duration = Duration.builder().prior(true).minutes(15).build(); Trigger trigger = new Trigger(duration, Related.START); VAlarm alarm = VAlarm.display(trigger, "Meeting in 15 minutes");
parameters
Constructor and Description |
---|
Trigger(Date date)
Creates a trigger property.
|
Trigger(Duration duration,
Related related)
Creates a trigger property.
|
Modifier and Type | Method and Description |
---|---|
Date |
getDate()
Gets the date-time that the alarm will trigger.
|
Duration |
getDuration()
Gets the relative time at which the alarm will trigger.
|
Related |
getRelated()
Gets the date-time field that the duration is relative to.
|
void |
setDate(Date date)
Sets the date-time that the alarm will trigger.
|
void |
setDuration(Duration duration,
Related related)
Sets a relative time at which the alarm will trigger.
|
void |
setRelated(Related related)
Sets the date-time field that the duration is relative to.
|
protected void |
validate(List<ICalComponent> components,
List<Warning> warnings)
Checks the property for data consistency problems or deviations from the
spec.
|
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
public Trigger(Duration duration, Related related)
duration
- the relative timerelated
- the date-time field that the duration is relative topublic Duration getDuration()
public void setDuration(Duration duration, Related related)
duration
- the relative timerelated
- the date-time field that the duration is relative topublic Date getDate()
public void setDate(Date date)
date
- the date-time the alarm will trigger.public Related getRelated()
public void setRelated(Related related)
related
- the field or null to removeprotected void validate(List<ICalComponent> components, List<Warning> warnings)
ICalProperty
validate
in class ICalProperty
components
- the hierarchy of components that the property belongs
towarnings
- the list to add the warnings toCopyright © 2013-2014 Michael Angstadt. All Rights Reserved.