Class CalendarEventImpl
java.lang.Object
ch.tocco.nice2.optional.calendar.impl.ical.CalendarEventImpl
- All Implemented Interfaces:
CalendarEvent
,CalendarAware
,Cloneable
,Comparable<CalendarEvent>
- Direct Known Subclasses:
RecurringEventImpl
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCalendarEventImpl
(CalendarEvent ev, CalendarDao calendarDao) CalendarEventImpl
(DateTimeValue startTime, @Nullable DateTimeValue endTime, String label, CalendarDao calendarDao, String location) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkStartEndTimes
(DateTimeValue start, @Nullable DateTimeValue end) clone()
Creates a deep copy of this event.int
org.joda.time.Instant
created()
boolean
If this event is attached to a calendar, this returns the calender that this event belongs to.The full description.getEnd()
getId()
The unique id of a calendar event.getLabel()
A short summary of this event.getStart()
getTargetEntity
(@Nullable Context ctx) Resolves and returns the target entity of the relation defined from this calendar event entity.getTargetEntity
(String relationName, @Nullable Context ctx) org.joda.time.DateTimeZone
A shortcut for#getStart().getTimeZone()
int
hashCode()
boolean
isAllDay()
Returns whether this is an allday event.boolean
resolveRelation
(@Nullable Context ctx) Resolves the relation from this calendar event entity.resolveRelation
(String relationName, @Nullable Context ctx) void
save()
Saves all properties of this event to the database.void
saveAndLink
(String relationName, Entity target) Saves this calendar event into the database and links it to the specified target entity.void
void
setCalendar
(Calendar calendar) void
setCreated
(org.joda.time.Instant instant) void
setDescription
(String description) void
setEnd
(@Nullable DateTimeValue end) void
void
void
setLocation
(String location) void
setOccurrence
(boolean occurrence) void
setOnlineMeetingUrl
(URI onlineMeetingUrl) void
setStart
(DateTimeValue start) void
setStartAndEnd
(DateTimeValue start, @Nullable DateTimeValue end) Sets start and end date and checks for valid values.toString()
-
Field Details
-
calendarDao
-
-
Constructor Details
-
CalendarEventImpl
public CalendarEventImpl(DateTimeValue startTime, @Nullable @Nullable DateTimeValue endTime, String label, CalendarDao calendarDao, String location) -
CalendarEventImpl
-
-
Method Details
-
checkStartEndTimes
-
getTimeZone
public org.joda.time.DateTimeZone getTimeZone()Description copied from interface:CalendarEvent
A shortcut for#getStart().getTimeZone()
- Specified by:
getTimeZone
in interfaceCalendarEvent
-
getCalendar
Description copied from interface:CalendarEvent
If this event is attached to a calendar, this returns the calender that this event belongs to.- Specified by:
getCalendar
in interfaceCalendarEvent
-
setCalendar
- Specified by:
setCalendar
in interfaceCalendarAware
-
getId
Description copied from interface:CalendarEvent
The unique id of a calendar event. This is unique across all calendar events of all calendars.- Specified by:
getId
in interfaceCalendarEvent
-
setId
-
getLabel
Description copied from interface:CalendarEvent
A short summary of this event.- Specified by:
getLabel
in interfaceCalendarEvent
-
setLabel
- Specified by:
setLabel
in interfaceCalendarEvent
-
getDescription
Description copied from interface:CalendarEvent
The full description.- Specified by:
getDescription
in interfaceCalendarEvent
-
setDescription
- Specified by:
setDescription
in interfaceCalendarEvent
-
created
public org.joda.time.Instant created()- Specified by:
created
in interfaceCalendarEvent
- Returns:
- the timestamp when this event has been created.
-
isAllDay
public boolean isAllDay()Description copied from interface:CalendarEvent
Returns whether this is an allday event. Allday events have only a start value.- Specified by:
isAllDay
in interfaceCalendarEvent
-
getStart
- Specified by:
getStart
in interfaceCalendarEvent
- Returns:
- the start of this event
-
getEnd
- Specified by:
getEnd
in interfaceCalendarEvent
-
setStartAndEnd
Description copied from interface:CalendarEvent
Sets start and end date and checks for valid values.- Specified by:
setStartAndEnd
in interfaceCalendarEvent
-
setStart
- Specified by:
setStart
in interfaceCalendarEvent
-
setEnd
- Specified by:
setEnd
in interfaceCalendarEvent
-
isOccurrence
public boolean isOccurrence()- Specified by:
isOccurrence
in interfaceCalendarEvent
- Returns:
- whether this calendar event is part of a recurrence set that has been generated
-
setOccurrence
public void setOccurrence(boolean occurrence) - Specified by:
setOccurrence
in interfaceCalendarEvent
-
resolveRelation
Description copied from interface:CalendarEvent
Resolves the relation from this calendar event entity. The relation is defined on the calendar of this event.
- Specified by:
resolveRelation
in interfaceCalendarEvent
- Throws:
CalendarDataAccessException
-
resolveRelation
public Relation resolveRelation(String relationName, @Nullable @Nullable Context ctx) throws CalendarDataAccessException - Specified by:
resolveRelation
in interfaceCalendarEvent
- Throws:
CalendarDataAccessException
-
getTargetEntity
Description copied from interface:CalendarEvent
Resolves and returns the target entity of the relation defined from this calendar event entity. The relation is defined on the calendar of this event.
- Specified by:
getTargetEntity
in interfaceCalendarEvent
- Throws:
CalendarDataAccessException
-
getTargetEntity
public Entity getTargetEntity(String relationName, @Nullable @Nullable Context ctx) throws CalendarDataAccessException - Specified by:
getTargetEntity
in interfaceCalendarEvent
- Throws:
CalendarDataAccessException
-
saveAndLink
Description copied from interface:CalendarEvent
Saves this calendar event into the database and links it to the specified target entity. The event must be associated to a calender which is saved if not already present in the database, too.- Specified by:
saveAndLink
in interfaceCalendarEvent
-
save
public void save()Description copied from interface:CalendarEvent
Saves all properties of this event to the database.- Specified by:
save
in interfaceCalendarEvent
-
saveAndRelateCalendar
public void saveAndRelateCalendar()- Specified by:
saveAndRelateCalendar
in interfaceCalendarEvent
-
getEntity
- Specified by:
getEntity
in interfaceCalendarEvent
- Returns:
- the entity representing this calendar event, or null if none is found
-
setLocation
- Specified by:
setLocation
in interfaceCalendarEvent
-
getLocation
- Specified by:
getLocation
in interfaceCalendarEvent
-
setOnlineMeetingUrl
- Specified by:
setOnlineMeetingUrl
in interfaceCalendarEvent
-
getOnlineMeetingUrl
- Specified by:
getOnlineMeetingUrl
in interfaceCalendarEvent
-
clone
Description copied from interface:CalendarEvent
Creates a deep copy of this event.- Specified by:
clone
in interfaceCalendarEvent
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CalendarEvent>
-
setCreated
public void setCreated(org.joda.time.Instant instant)
-