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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCalendarEventImpl(CalendarEvent ev, CalendarDao calendarDao) CalendarEventImpl(DateTimeValue startTime, @Nullable DateTimeValue endTime, String label, CalendarDao calendarDao, String location) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckStartEndTimes(DateTimeValue start, @Nullable DateTimeValue end) clone()Creates a deep copy of this event.intorg.joda.time.Instantcreated()booleanIf 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.DateTimeZoneA shortcut for#getStart().getTimeZone()inthashCode()booleanisAllDay()Returns whether this is an allday event.booleanresolveRelation(@Nullable Context ctx) Resolves the relation from this calendar event entity.resolveRelation(String relationName, @Nullable Context ctx) voidsave()Saves all properties of this event to the database.voidsaveAndLink(String relationName, Entity target) Saves this calendar event into the database and links it to the specified target entity.voidvoidsetCalendar(Calendar calendar) voidsetCreated(org.joda.time.Instant instant) voidsetDescription(String description) voidsetEnd(@Nullable DateTimeValue end) voidvoidvoidsetLocation(String location) voidsetOccurrence(boolean occurrence) voidsetOnlineMeetingUrl(URI onlineMeetingUrl) voidsetStart(DateTimeValue start) voidsetStartAndEnd(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:CalendarEventA shortcut for#getStart().getTimeZone()- Specified by:
getTimeZonein interfaceCalendarEvent
-
getCalendar
Description copied from interface:CalendarEventIf this event is attached to a calendar, this returns the calender that this event belongs to.- Specified by:
getCalendarin interfaceCalendarEvent
-
setCalendar
- Specified by:
setCalendarin interfaceCalendarAware
-
getId
Description copied from interface:CalendarEventThe unique id of a calendar event. This is unique across all calendar events of all calendars.- Specified by:
getIdin interfaceCalendarEvent
-
setId
-
getLabel
Description copied from interface:CalendarEventA short summary of this event.- Specified by:
getLabelin interfaceCalendarEvent
-
setLabel
- Specified by:
setLabelin interfaceCalendarEvent
-
getDescription
Description copied from interface:CalendarEventThe full description.- Specified by:
getDescriptionin interfaceCalendarEvent
-
setDescription
- Specified by:
setDescriptionin interfaceCalendarEvent
-
created
public org.joda.time.Instant created()- Specified by:
createdin interfaceCalendarEvent- Returns:
- the timestamp when this event has been created.
-
isAllDay
public boolean isAllDay()Description copied from interface:CalendarEventReturns whether this is an allday event. Allday events have only a start value.- Specified by:
isAllDayin interfaceCalendarEvent
-
getStart
- Specified by:
getStartin interfaceCalendarEvent- Returns:
- the start of this event
-
getEnd
- Specified by:
getEndin interfaceCalendarEvent
-
setStartAndEnd
Description copied from interface:CalendarEventSets start and end date and checks for valid values.- Specified by:
setStartAndEndin interfaceCalendarEvent
-
setStart
- Specified by:
setStartin interfaceCalendarEvent
-
setEnd
- Specified by:
setEndin interfaceCalendarEvent
-
isOccurrence
public boolean isOccurrence()- Specified by:
isOccurrencein interfaceCalendarEvent- Returns:
- whether this calendar event is part of a recurrence set that has been generated
-
setOccurrence
public void setOccurrence(boolean occurrence) - Specified by:
setOccurrencein interfaceCalendarEvent
-
resolveRelation
Description copied from interface:CalendarEventResolves the relation from this calendar event entity. The relation is defined on the calendar of this event.
- Specified by:
resolveRelationin interfaceCalendarEvent- Throws:
CalendarDataAccessException
-
resolveRelation
public Relation resolveRelation(String relationName, @Nullable @Nullable Context ctx) throws CalendarDataAccessException - Specified by:
resolveRelationin interfaceCalendarEvent- Throws:
CalendarDataAccessException
-
getTargetEntity
Description copied from interface:CalendarEventResolves 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:
getTargetEntityin interfaceCalendarEvent- Throws:
CalendarDataAccessException
-
getTargetEntity
public Entity getTargetEntity(String relationName, @Nullable @Nullable Context ctx) throws CalendarDataAccessException - Specified by:
getTargetEntityin interfaceCalendarEvent- Throws:
CalendarDataAccessException
-
saveAndLink
Description copied from interface:CalendarEventSaves 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:
saveAndLinkin interfaceCalendarEvent
-
save
public void save()Description copied from interface:CalendarEventSaves all properties of this event to the database.- Specified by:
savein interfaceCalendarEvent
-
saveAndRelateCalendar
public void saveAndRelateCalendar()- Specified by:
saveAndRelateCalendarin interfaceCalendarEvent
-
getEntity
- Specified by:
getEntityin interfaceCalendarEvent- Returns:
- the entity representing this calendar event, or null if none is found
-
setLocation
- Specified by:
setLocationin interfaceCalendarEvent
-
getLocation
- Specified by:
getLocationin interfaceCalendarEvent
-
setOnlineMeetingUrl
- Specified by:
setOnlineMeetingUrlin interfaceCalendarEvent
-
getOnlineMeetingUrl
- Specified by:
getOnlineMeetingUrlin interfaceCalendarEvent
-
clone
Description copied from interface:CalendarEventCreates a deep copy of this event.- Specified by:
clonein interfaceCalendarEvent- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
equals
-
hashCode
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<CalendarEvent>
-
setCreated
public void setCreated(org.joda.time.Instant instant)
-