jfxtras.icalendarfx.parameters.AlarmTriggerRelationship Maven / Gradle / Ivy
package jfxtras.icalendarfx.parameters;
import jfxtras.icalendarfx.parameters.AlarmTriggerRelationship;
import jfxtras.icalendarfx.parameters.VParameterBase;
import jfxtras.icalendarfx.parameters.AlarmTriggerRelationship.AlarmTriggerRelationshipType;
import jfxtras.icalendarfx.utilities.StringConverter;
/**
* 3.2.14. Alarm Trigger Relationship
Parameter Name: RELATED
Purpose: To specify the relationship of the alarm trigger with
respect to the start or end of the calendar component.
Description: This parameter can be specified on properties that
specify an alarm trigger with a "DURATION" value type. The
parameter specifies whether the alarm will trigger relative to the
start or end of the calendar component. The parameter value START
will set the alarm to trigger off the start of the calendar
component; the parameter value END will set the alarm to trigger
off the end of the calendar component. If the parameter is not
specified on an allowable property, then the default is START.
Format Definition: This property parameter is defined by the following notation::
- triggerparam
- "RELATED" "="
- ("START" ; Trigger off of start
- / "END") ; Trigger off of end
Example:
- TRIGGER;RELATED=END:PT5M
RFC 5545 iCalendar September 2009
*
* @author David Bal
*
*/
public class AlarmTriggerRelationship extends VParameterBase
{
private static final StringConverter CONVERTER = new StringConverter()
{
@Override
public String toString(AlarmTriggerRelationshipType object)
{
return object.toString();
}
@Override
public AlarmTriggerRelationshipType fromString(String string)
{
return AlarmTriggerRelationshipType.valueOf(string.toUpperCase());
}
};
/** Create default AlarmTriggerRelationship with property value set to START */
public AlarmTriggerRelationship()
{
super(AlarmTriggerRelationshipType.START, CONVERTER);
}
/** Create new AlarmTriggerRelationshipType with property value set to input parameter */
public AlarmTriggerRelationship(AlarmTriggerRelationshipType value)
{
super(value, CONVERTER);
}
/** Create deep copy of source AlarmTriggerRelationship */
public AlarmTriggerRelationship(AlarmTriggerRelationship source)
{
super(source, CONVERTER);
}
/** Property value types for AlarmTriggerRelationship */
public enum AlarmTriggerRelationshipType
{
START,
END;
}
public static AlarmTriggerRelationship parse(String content)
{
return AlarmTriggerRelationship.parse(new AlarmTriggerRelationship(), content);
}
}