Package org.silverpeas.core.calendar
Interface PlannableOnCalendar
-
- All Superinterfaces:
Plannable
,Serializable
- All Known Implementing Classes:
CalendarEvent
public interface PlannableOnCalendar extends Plannable, Serializable
A plannable object is an object that can be planned in a calendar and that can be serialized on a data source. A plannable object is defined in the timeline by a start datetime and by an end datetime with split-minute accuracy. According to the type of the plannable object, the end datetime can be undefined. When a plannable object is created, the temporal type of the event's end must be the same temporal type that the event's start, and the plannable object should convert them into a datetime with split-minute accuracy when accessing them.- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OperationResult<CalendarEvent,CalendarEventOccurrence>
delete()
Deletes this planned object from the calendar it belongs to.Calendar
getCalendar()
Gets the calendar into which this plannable object is finally planned.Temporal
getEndDate()
The end date or datetime of the plannable object.String
getId()
Gets the unique identifier of this plannable object.Temporal
getStartDate()
The start date or datetime of the plannable object.String
getTitle()
Gets the title of this plannable object.boolean
isOnAllDay()
Does this plannable object extend over all the day(s)?boolean
isPlanned()
Is this planned in a given calendar?PlannableOnCalendar
planOn(Calendar aCalendar)
Saves this plannable object into the specified calendar.void
setTitle(String title)
Sets a title to this plannable object.OperationResult<CalendarEvent,CalendarEventOccurrence>
update()
Updates this planned object in the underlying calendar it belongs to.
-
-
-
Method Detail
-
getId
String getId()
Gets the unique identifier of this plannable object.- Returns:
- the unique identifier of this plannable object.
-
getCalendar
Calendar getCalendar()
Gets the calendar into which this plannable object is finally planned.- Returns:
- the calendar into which this object is planned or null if it isn't yet planned.
-
getStartDate
Temporal getStartDate()
The start date or datetime of the plannable object. It is the inclusive lower bound of the period into which this object occurs in a calendar. If this plannable object is on all days, then gets a date. Otherwise, gets a datetime in UTC/Greenwich.- Returns:
- a temporal instance of
LocalDate
if the object is on all the day or a temporal instance ofOffsetDateTime
) otherwise.
-
getEndDate
Temporal getEndDate()
The end date or datetime of the plannable object. It is the exclusive upper bound of the period into which this object occurs in a calendar. If this plannable object is on all days, then gets a date. Otherwise, gets a datetime in UTC/Greenwich. According to the type of the plannable object, the end datetime can be undefined; in this case, it must be indicated as such in the implemented method's documentation.- Returns:
- a temporal instance of
LocalDate
if the object is on all the day or a temporal instance ofOffsetDateTime
) otherwise.
-
isOnAllDay
boolean isOnAllDay()
Does this plannable object extend over all the day(s)? In the case it is on all the day(s) from the start date to the end date, the time in the datetime returned by the methodsgetStartDate()
andgetEndDate()
is meaningless and shouldn't be taken into account.- Returns:
- true if this plannable object extend over all the day(s) between its start date and its end date.
-
getTitle
String getTitle()
Gets the title of this plannable object. A title is a short resume or the subject of the plannable object.- Returns:
- a short text about the reason of this plannable object.
-
setTitle
void setTitle(String title)
Sets a title to this plannable object. A title is a short resume or the subject of the plannable object.- Parameters:
title
- a short text about the reason of this plannable object.
-
planOn
PlannableOnCalendar planOn(Calendar aCalendar)
Saves this plannable object into the specified calendar. This will add this plannable object into the given calendar, and it will have hence a unique identifier that will uniquely identify it among all others plannable objects in the calendar. If this was already planned in a calendar, nothing is done.- Parameters:
aCalendar
- a calendar on which this object has to be planned.- Returns:
- itself.
-
isPlanned
boolean isPlanned()
Is this planned in a given calendar?- Returns:
- true if this event is planned in a calendar, false otherwise.
-
delete
OperationResult<CalendarEvent,CalendarEventOccurrence> delete()
Deletes this planned object from the calendar it belongs to. If it was not planned (aka saved) in a given calendar, then nothing is done.
-
update
OperationResult<CalendarEvent,CalendarEventOccurrence> update()
Updates this planned object in the underlying calendar it belongs to. If it was not planned (aka saved) in a given calendar, then nothing is done.
-
-