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,
ICalVersion version,
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, ICalVersion version, List<Warning> warnings)
ICalProperty
Checks the property for data consistency problems or deviations from the spec.
This method should be overridden by child classes that wish to provide validation logic. The default implementation of this method does nothing.
validate
in class ICalProperty
components
- the hierarchy of components that the property belongs
toversion
- the version to validate againstwarnings
- the list to add the warnings toCopyright © 2013-2015 Michael Angstadt. All Rights Reserved.