- Enclosing class:
- ICalBuilder
-
Field Summary
Fields inherited from class org.bzdev.net.calendar.ICalBuilder.Base
contentLines
-
Constructor Summary
ConstructorsConstructorDescriptionToDo
(String uid, int sequence, TemporalAccessor created, TemporalAccessor lastModified) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Create the content for this event (a sequence of lines) that will make up part of an iCalendar file).void
setCompleted
(TemporalAccessor completed) Set the time indicating that this iCalendar component has been completed.void
setDescription
(String description, String... parameters) Set the description for this event.void
setDueTime
(TemporalAccessor due, String... params) Set the date-time due time for this component.void
setDuration
(int duration, ICalBuilder.Units units) Set the duration for an iCalendar component.void
setLocation
(String location, String... parameters) Set the location for this iCalendar component.void
setPercentCompleted
(int percent) Set the percent-completed field for this iCalendar componentvoid
setPriority
(int priority) Set the priority of this iCalendar component.void
setStartTime
(TemporalAccessor startTime, String... params) Set the starting time for this component.void
setStatus
(ICalBuilder.Status status) Set the status for this iCalendar component.void
setSummary
(String summary, String... parameters) Set the summary property for this event.Methods inherited from class org.bzdev.net.calendar.ICalBuilder.CommonWithAlarm
clearContentLines
Methods inherited from class org.bzdev.net.calendar.ICalBuilder.Common
addAttendee, addCategories, addComment, addContact, addRelatedTo, setClassification, setGeo, setURL
Methods inherited from class org.bzdev.net.calendar.ICalBuilder.Base
addAttachment, addAttachment, addProperty, addProperty, addProperty
-
Constructor Details
-
ToDo
public ToDo(String uid, int sequence, TemporalAccessor created, TemporalAccessor lastModified) throws IllegalArgumentException Constructor. The first argument (uid) is described in Section 3.8.4.7 of RFC 5545. The second argument (sequence) is described in Section 3.8.7.4 of RFC 5545. The third argument (created) is described in Section 3.8.7.1 of RFC 5545. The fourth argument (lastModified) is described in Section of 3.8.7.3 RFC 5545.The types of the
TemporalAccessor
arguments must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Parameters:
uid
- a unique identifier labeling this eventsequence
- the sequence number for updates for this eventcreated
- the time at which this event was createdlastModified
- the last time at which this event was modified- Throws:
IllegalArgumentException
- an argument was null or the sequence number was negative or a temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
-
-
Method Details
-
setStartTime
Set the starting time for this component. Please see Section 3.8.2.4 of RFC 5545 for a description of the start-time property. Parameters should not be used unless the run-time type of the first argument isLocalDate
orLocalDateTime
. The parameters defined by RFC 5545 are- VALUE. Values (which follow an "=" character) can be DATE-TIME or DATE.
- TZID. Please see Section 3.2.19 of RFC 5545.
The type of the
TemporalAccessor
argument must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Overrides:
setStartTime
in classICalBuilder.Common
- Parameters:
startTime
- the time at which this component starts; null if no start time is specifiedparams
- the parameters for the start time, if any- Throws:
IllegalArgumentException
- the temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
-
setDueTime
Set the date-time due time for this component. Please see Section 3.8.2.3 of RFC 5545 for a description of the date-time due property. Parameters should not be used unless the run-time type of the first argument isLocalDate
orLocalDateTime
. The parameters defined by RFC 5545 are- VALUE. Values (which follow an "=" character) can be DATE-TIME or DATE.
- TZID. Please see Section 3.2.19 of RFC 5545.
The type of the
TemporalAccessor
argument must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Parameters:
due
- the time at which this component is due; null if such a time is not specifiedparams
- the parameters for due, if any- Throws:
IllegalStateException
- two methods used to set the due timeIllegalArgumentException
- the temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
-
setSummary
Set the summary property for this event. The first argument is typically a short string describing an event and is described in Section 3.8.1.12 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Overrides:
setSummary
in classICalBuilder.Common
- Parameters:
summary
- a summary describing this event; null if there is no summaryparameters
- the parameters for this property
-
setDescription
Set the description for this event. The description of an iCalendar component and is described in Section 3.8.1.5 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Overrides:
setDescription
in classICalBuilder.Common
- Parameters:
description
- a full description of this event; null if there is no descriptionparameters
- the parameters for this property
-
setLocation
Set the location for this iCalendar component. The location property describes the location of an event and is described in Section 3.8.1.7 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Overrides:
setLocation
in classICalBuilder.Common
- Parameters:
location
- the location for this event; null if no location is specifiedparameters
- the parameters for this property
-
setDuration
Set the duration for an iCalendar component. Durations are define in Section 3.8.2.5 of RFC 5545- Overrides:
setDuration
in classICalBuilder.Base
- Parameters:
duration
- the duration, either a positive integer or 0 if the duration should be ignoredunits
- the units for the duration (ICalBuilder.Units.SECONDS
,ICalBuilder.Units.MINUTES
,ICalBuilder.Units.HOURS
,ICalBuilder.Units.DAYS
, orICalBuilder.Units.WEEKS
); null only if the duration is 0- Throws:
UnsupportedOperationException
- if an iCalendar component does not have a duration.
-
setStatus
Set the status for this iCalendar component. The status property is described in Section 3.8.1.11 of RFC 5545.- Overrides:
setStatus
in classICalBuilder.Common
- Parameters:
status
- the status (ICalBuilder.Status.NEEDS_ACTION
,ICalBuilder.Status.COMPLETED
,ICalBuilder.Status.IN_PROCESS
, orICalBuilder.Status.CANCELLED
).- Throws:
IllegalArgumentException
- the status is not appropriate for this component
-
setPriority
public void setPriority(int priority) Set the priority of this iCalendar component. Please see Section 3.8.1.9 of RFC 5545 for a description of the priority property.- Overrides:
setPriority
in classICalBuilder.Common
- Parameters:
priority
- the priority, a value in the range [0, 9]
-
setPercentCompleted
public void setPercentCompleted(int percent) Set the percent-completed field for this iCalendar component- Parameters:
percent
- the percent completed, where 0 indicates that the "to-do" has not yet started and 100 indicates that it has been completed- Throws:
IllegalArgumentException
- the argument is less than zero or larger than 100
-
setCompleted
Set the time indicating that this iCalendar component has been completed.The type of the
TemporalAccessor
argument must be eitherLocalDate
,LocalDateTime
,ZonedDateTime
, orInstant
, The classesLocalDate
andLocalDateTime
will be treated as a "floating time" (see RFC 5545) and bothZonedDateTime
andInstant
will have their times represented using UTC. To convert a LocalDate value to a LocalDateTime value, use methods such asLocalDate.atStartOfDay()
. To convert a LocalDateTime value to a ZonedDateTime object, use the methodLocalDateTime.atZone(java.time.ZoneId)
. To get the default time zone for the Java virtual machine, use the methodZoneId.systemDefault()
.- Parameters:
completed
- the time at which this component was completed- Throws:
IllegalArgumentException
- the temporal accessor argument's type is not a recognized subclass of TemporalAccesssor
-
createContentLines
protected void createContentLines()Description copied from class:ICalBuilder.CommonWithAlarm
Create the content for this event (a sequence of lines) that will make up part of an iCalendar file).- Overrides:
createContentLines
in classICalBuilder.CommonWithAlarm
-