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.
|
Trigger(Trigger original)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Trigger |
copy()
Creates a copy of this property object.
|
boolean |
equals(Object obj) |
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.
|
int |
hashCode() |
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 Map<String,Object> |
toStringValues()
Gets string representations of the class's fields for the
ICalProperty.toString() method. |
protected void |
validate(List<ICalComponent> components,
ICalVersion version,
List<Warning> warnings)
Checks the property for data consistency problems or deviations from the
specifications.
|
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, toString, validate
public Trigger(Duration duration, Related related)
duration
- the relative timerelated
- the date-time field that the duration is relative topublic Trigger(Date date)
date
- the date-time the alarm will trigger.public 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 specifications.
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 toprotected Map<String,Object> toStringValues()
ICalProperty
Gets string representations of the class's fields for the
ICalProperty.toString()
method.
Meant to be overridden by child classes. The default implementation returns an empty map.
toStringValues
in class ICalProperty
public Trigger copy()
ICalProperty
Creates a copy of this property object.
The default implementation of this method uses reflection to look for a copy constructor. Child classes SHOULD override this method to avoid the performance overhead involved in using reflection.
The child class's copy constructor, if present, MUST invoke the
ICalProperty.ICalProperty(ICalProperty)
super constructor to ensure that the
parameters are also copied.
This method MUST be overridden by the child class if the child class does
not have a copy constructor. Otherwise, an
UnsupportedOperationException
will be thrown when an attempt is
made to copy the property (such as in the
ICalendar class's copy constructor
).
copy
in class ICalProperty
public int hashCode()
hashCode
in class ICalProperty
public boolean equals(Object obj)
equals
in class ICalProperty
Copyright © 2013-2016 Michael Angstadt. All Rights Reserved.