001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.calendar.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link CalEvent}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       CalEvent
031     * @generated
032     */
033    public class CalEventWrapper implements CalEvent, ModelWrapper<CalEvent> {
034            public CalEventWrapper(CalEvent calEvent) {
035                    _calEvent = calEvent;
036            }
037    
038            public Class<?> getModelClass() {
039                    return CalEvent.class;
040            }
041    
042            public String getModelClassName() {
043                    return CalEvent.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("eventId", getEventId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("createDate", getCreateDate());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("title", getTitle());
058                    attributes.put("description", getDescription());
059                    attributes.put("location", getLocation());
060                    attributes.put("startDate", getStartDate());
061                    attributes.put("endDate", getEndDate());
062                    attributes.put("durationHour", getDurationHour());
063                    attributes.put("durationMinute", getDurationMinute());
064                    attributes.put("allDay", getAllDay());
065                    attributes.put("timeZoneSensitive", getTimeZoneSensitive());
066                    attributes.put("type", getType());
067                    attributes.put("repeating", getRepeating());
068                    attributes.put("recurrence", getRecurrence());
069                    attributes.put("remindBy", getRemindBy());
070                    attributes.put("firstReminder", getFirstReminder());
071                    attributes.put("secondReminder", getSecondReminder());
072    
073                    return attributes;
074            }
075    
076            public void setModelAttributes(Map<String, Object> attributes) {
077                    String uuid = (String)attributes.get("uuid");
078    
079                    if (uuid != null) {
080                            setUuid(uuid);
081                    }
082    
083                    Long eventId = (Long)attributes.get("eventId");
084    
085                    if (eventId != null) {
086                            setEventId(eventId);
087                    }
088    
089                    Long groupId = (Long)attributes.get("groupId");
090    
091                    if (groupId != null) {
092                            setGroupId(groupId);
093                    }
094    
095                    Long companyId = (Long)attributes.get("companyId");
096    
097                    if (companyId != null) {
098                            setCompanyId(companyId);
099                    }
100    
101                    Long userId = (Long)attributes.get("userId");
102    
103                    if (userId != null) {
104                            setUserId(userId);
105                    }
106    
107                    String userName = (String)attributes.get("userName");
108    
109                    if (userName != null) {
110                            setUserName(userName);
111                    }
112    
113                    Date createDate = (Date)attributes.get("createDate");
114    
115                    if (createDate != null) {
116                            setCreateDate(createDate);
117                    }
118    
119                    Date modifiedDate = (Date)attributes.get("modifiedDate");
120    
121                    if (modifiedDate != null) {
122                            setModifiedDate(modifiedDate);
123                    }
124    
125                    String title = (String)attributes.get("title");
126    
127                    if (title != null) {
128                            setTitle(title);
129                    }
130    
131                    String description = (String)attributes.get("description");
132    
133                    if (description != null) {
134                            setDescription(description);
135                    }
136    
137                    String location = (String)attributes.get("location");
138    
139                    if (location != null) {
140                            setLocation(location);
141                    }
142    
143                    Date startDate = (Date)attributes.get("startDate");
144    
145                    if (startDate != null) {
146                            setStartDate(startDate);
147                    }
148    
149                    Date endDate = (Date)attributes.get("endDate");
150    
151                    if (endDate != null) {
152                            setEndDate(endDate);
153                    }
154    
155                    Integer durationHour = (Integer)attributes.get("durationHour");
156    
157                    if (durationHour != null) {
158                            setDurationHour(durationHour);
159                    }
160    
161                    Integer durationMinute = (Integer)attributes.get("durationMinute");
162    
163                    if (durationMinute != null) {
164                            setDurationMinute(durationMinute);
165                    }
166    
167                    Boolean allDay = (Boolean)attributes.get("allDay");
168    
169                    if (allDay != null) {
170                            setAllDay(allDay);
171                    }
172    
173                    Boolean timeZoneSensitive = (Boolean)attributes.get("timeZoneSensitive");
174    
175                    if (timeZoneSensitive != null) {
176                            setTimeZoneSensitive(timeZoneSensitive);
177                    }
178    
179                    String type = (String)attributes.get("type");
180    
181                    if (type != null) {
182                            setType(type);
183                    }
184    
185                    Boolean repeating = (Boolean)attributes.get("repeating");
186    
187                    if (repeating != null) {
188                            setRepeating(repeating);
189                    }
190    
191                    String recurrence = (String)attributes.get("recurrence");
192    
193                    if (recurrence != null) {
194                            setRecurrence(recurrence);
195                    }
196    
197                    Integer remindBy = (Integer)attributes.get("remindBy");
198    
199                    if (remindBy != null) {
200                            setRemindBy(remindBy);
201                    }
202    
203                    Integer firstReminder = (Integer)attributes.get("firstReminder");
204    
205                    if (firstReminder != null) {
206                            setFirstReminder(firstReminder);
207                    }
208    
209                    Integer secondReminder = (Integer)attributes.get("secondReminder");
210    
211                    if (secondReminder != null) {
212                            setSecondReminder(secondReminder);
213                    }
214            }
215    
216            /**
217            * Returns the primary key of this cal event.
218            *
219            * @return the primary key of this cal event
220            */
221            public long getPrimaryKey() {
222                    return _calEvent.getPrimaryKey();
223            }
224    
225            /**
226            * Sets the primary key of this cal event.
227            *
228            * @param primaryKey the primary key of this cal event
229            */
230            public void setPrimaryKey(long primaryKey) {
231                    _calEvent.setPrimaryKey(primaryKey);
232            }
233    
234            /**
235            * Returns the uuid of this cal event.
236            *
237            * @return the uuid of this cal event
238            */
239            public java.lang.String getUuid() {
240                    return _calEvent.getUuid();
241            }
242    
243            /**
244            * Sets the uuid of this cal event.
245            *
246            * @param uuid the uuid of this cal event
247            */
248            public void setUuid(java.lang.String uuid) {
249                    _calEvent.setUuid(uuid);
250            }
251    
252            /**
253            * Returns the event ID of this cal event.
254            *
255            * @return the event ID of this cal event
256            */
257            public long getEventId() {
258                    return _calEvent.getEventId();
259            }
260    
261            /**
262            * Sets the event ID of this cal event.
263            *
264            * @param eventId the event ID of this cal event
265            */
266            public void setEventId(long eventId) {
267                    _calEvent.setEventId(eventId);
268            }
269    
270            /**
271            * Returns the group ID of this cal event.
272            *
273            * @return the group ID of this cal event
274            */
275            public long getGroupId() {
276                    return _calEvent.getGroupId();
277            }
278    
279            /**
280            * Sets the group ID of this cal event.
281            *
282            * @param groupId the group ID of this cal event
283            */
284            public void setGroupId(long groupId) {
285                    _calEvent.setGroupId(groupId);
286            }
287    
288            /**
289            * Returns the company ID of this cal event.
290            *
291            * @return the company ID of this cal event
292            */
293            public long getCompanyId() {
294                    return _calEvent.getCompanyId();
295            }
296    
297            /**
298            * Sets the company ID of this cal event.
299            *
300            * @param companyId the company ID of this cal event
301            */
302            public void setCompanyId(long companyId) {
303                    _calEvent.setCompanyId(companyId);
304            }
305    
306            /**
307            * Returns the user ID of this cal event.
308            *
309            * @return the user ID of this cal event
310            */
311            public long getUserId() {
312                    return _calEvent.getUserId();
313            }
314    
315            /**
316            * Sets the user ID of this cal event.
317            *
318            * @param userId the user ID of this cal event
319            */
320            public void setUserId(long userId) {
321                    _calEvent.setUserId(userId);
322            }
323    
324            /**
325            * Returns the user uuid of this cal event.
326            *
327            * @return the user uuid of this cal event
328            * @throws SystemException if a system exception occurred
329            */
330            public java.lang.String getUserUuid()
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return _calEvent.getUserUuid();
333            }
334    
335            /**
336            * Sets the user uuid of this cal event.
337            *
338            * @param userUuid the user uuid of this cal event
339            */
340            public void setUserUuid(java.lang.String userUuid) {
341                    _calEvent.setUserUuid(userUuid);
342            }
343    
344            /**
345            * Returns the user name of this cal event.
346            *
347            * @return the user name of this cal event
348            */
349            public java.lang.String getUserName() {
350                    return _calEvent.getUserName();
351            }
352    
353            /**
354            * Sets the user name of this cal event.
355            *
356            * @param userName the user name of this cal event
357            */
358            public void setUserName(java.lang.String userName) {
359                    _calEvent.setUserName(userName);
360            }
361    
362            /**
363            * Returns the create date of this cal event.
364            *
365            * @return the create date of this cal event
366            */
367            public java.util.Date getCreateDate() {
368                    return _calEvent.getCreateDate();
369            }
370    
371            /**
372            * Sets the create date of this cal event.
373            *
374            * @param createDate the create date of this cal event
375            */
376            public void setCreateDate(java.util.Date createDate) {
377                    _calEvent.setCreateDate(createDate);
378            }
379    
380            /**
381            * Returns the modified date of this cal event.
382            *
383            * @return the modified date of this cal event
384            */
385            public java.util.Date getModifiedDate() {
386                    return _calEvent.getModifiedDate();
387            }
388    
389            /**
390            * Sets the modified date of this cal event.
391            *
392            * @param modifiedDate the modified date of this cal event
393            */
394            public void setModifiedDate(java.util.Date modifiedDate) {
395                    _calEvent.setModifiedDate(modifiedDate);
396            }
397    
398            /**
399            * Returns the title of this cal event.
400            *
401            * @return the title of this cal event
402            */
403            public java.lang.String getTitle() {
404                    return _calEvent.getTitle();
405            }
406    
407            /**
408            * Sets the title of this cal event.
409            *
410            * @param title the title of this cal event
411            */
412            public void setTitle(java.lang.String title) {
413                    _calEvent.setTitle(title);
414            }
415    
416            /**
417            * Returns the description of this cal event.
418            *
419            * @return the description of this cal event
420            */
421            public java.lang.String getDescription() {
422                    return _calEvent.getDescription();
423            }
424    
425            /**
426            * Sets the description of this cal event.
427            *
428            * @param description the description of this cal event
429            */
430            public void setDescription(java.lang.String description) {
431                    _calEvent.setDescription(description);
432            }
433    
434            /**
435            * Returns the location of this cal event.
436            *
437            * @return the location of this cal event
438            */
439            public java.lang.String getLocation() {
440                    return _calEvent.getLocation();
441            }
442    
443            /**
444            * Sets the location of this cal event.
445            *
446            * @param location the location of this cal event
447            */
448            public void setLocation(java.lang.String location) {
449                    _calEvent.setLocation(location);
450            }
451    
452            /**
453            * Returns the start date of this cal event.
454            *
455            * @return the start date of this cal event
456            */
457            public java.util.Date getStartDate() {
458                    return _calEvent.getStartDate();
459            }
460    
461            /**
462            * Sets the start date of this cal event.
463            *
464            * @param startDate the start date of this cal event
465            */
466            public void setStartDate(java.util.Date startDate) {
467                    _calEvent.setStartDate(startDate);
468            }
469    
470            /**
471            * Returns the end date of this cal event.
472            *
473            * @return the end date of this cal event
474            */
475            public java.util.Date getEndDate() {
476                    return _calEvent.getEndDate();
477            }
478    
479            /**
480            * Sets the end date of this cal event.
481            *
482            * @param endDate the end date of this cal event
483            */
484            public void setEndDate(java.util.Date endDate) {
485                    _calEvent.setEndDate(endDate);
486            }
487    
488            /**
489            * Returns the duration hour of this cal event.
490            *
491            * @return the duration hour of this cal event
492            */
493            public int getDurationHour() {
494                    return _calEvent.getDurationHour();
495            }
496    
497            /**
498            * Sets the duration hour of this cal event.
499            *
500            * @param durationHour the duration hour of this cal event
501            */
502            public void setDurationHour(int durationHour) {
503                    _calEvent.setDurationHour(durationHour);
504            }
505    
506            /**
507            * Returns the duration minute of this cal event.
508            *
509            * @return the duration minute of this cal event
510            */
511            public int getDurationMinute() {
512                    return _calEvent.getDurationMinute();
513            }
514    
515            /**
516            * Sets the duration minute of this cal event.
517            *
518            * @param durationMinute the duration minute of this cal event
519            */
520            public void setDurationMinute(int durationMinute) {
521                    _calEvent.setDurationMinute(durationMinute);
522            }
523    
524            /**
525            * Returns the all day of this cal event.
526            *
527            * @return the all day of this cal event
528            */
529            public boolean getAllDay() {
530                    return _calEvent.getAllDay();
531            }
532    
533            /**
534            * Returns <code>true</code> if this cal event is all day.
535            *
536            * @return <code>true</code> if this cal event is all day; <code>false</code> otherwise
537            */
538            public boolean isAllDay() {
539                    return _calEvent.isAllDay();
540            }
541    
542            /**
543            * Sets whether this cal event is all day.
544            *
545            * @param allDay the all day of this cal event
546            */
547            public void setAllDay(boolean allDay) {
548                    _calEvent.setAllDay(allDay);
549            }
550    
551            /**
552            * Returns the time zone sensitive of this cal event.
553            *
554            * @return the time zone sensitive of this cal event
555            */
556            public boolean getTimeZoneSensitive() {
557                    return _calEvent.getTimeZoneSensitive();
558            }
559    
560            /**
561            * Returns <code>true</code> if this cal event is time zone sensitive.
562            *
563            * @return <code>true</code> if this cal event is time zone sensitive; <code>false</code> otherwise
564            */
565            public boolean isTimeZoneSensitive() {
566                    return _calEvent.isTimeZoneSensitive();
567            }
568    
569            /**
570            * Sets whether this cal event is time zone sensitive.
571            *
572            * @param timeZoneSensitive the time zone sensitive of this cal event
573            */
574            public void setTimeZoneSensitive(boolean timeZoneSensitive) {
575                    _calEvent.setTimeZoneSensitive(timeZoneSensitive);
576            }
577    
578            /**
579            * Returns the type of this cal event.
580            *
581            * @return the type of this cal event
582            */
583            public java.lang.String getType() {
584                    return _calEvent.getType();
585            }
586    
587            /**
588            * Sets the type of this cal event.
589            *
590            * @param type the type of this cal event
591            */
592            public void setType(java.lang.String type) {
593                    _calEvent.setType(type);
594            }
595    
596            /**
597            * Returns the repeating of this cal event.
598            *
599            * @return the repeating of this cal event
600            */
601            public boolean getRepeating() {
602                    return _calEvent.getRepeating();
603            }
604    
605            /**
606            * Returns <code>true</code> if this cal event is repeating.
607            *
608            * @return <code>true</code> if this cal event is repeating; <code>false</code> otherwise
609            */
610            public boolean isRepeating() {
611                    return _calEvent.isRepeating();
612            }
613    
614            /**
615            * Sets whether this cal event is repeating.
616            *
617            * @param repeating the repeating of this cal event
618            */
619            public void setRepeating(boolean repeating) {
620                    _calEvent.setRepeating(repeating);
621            }
622    
623            /**
624            * Returns the recurrence of this cal event.
625            *
626            * @return the recurrence of this cal event
627            */
628            public java.lang.String getRecurrence() {
629                    return _calEvent.getRecurrence();
630            }
631    
632            /**
633            * Sets the recurrence of this cal event.
634            *
635            * @param recurrence the recurrence of this cal event
636            */
637            public void setRecurrence(java.lang.String recurrence) {
638                    _calEvent.setRecurrence(recurrence);
639            }
640    
641            /**
642            * Returns the remind by of this cal event.
643            *
644            * @return the remind by of this cal event
645            */
646            public int getRemindBy() {
647                    return _calEvent.getRemindBy();
648            }
649    
650            /**
651            * Sets the remind by of this cal event.
652            *
653            * @param remindBy the remind by of this cal event
654            */
655            public void setRemindBy(int remindBy) {
656                    _calEvent.setRemindBy(remindBy);
657            }
658    
659            /**
660            * Returns the first reminder of this cal event.
661            *
662            * @return the first reminder of this cal event
663            */
664            public int getFirstReminder() {
665                    return _calEvent.getFirstReminder();
666            }
667    
668            /**
669            * Sets the first reminder of this cal event.
670            *
671            * @param firstReminder the first reminder of this cal event
672            */
673            public void setFirstReminder(int firstReminder) {
674                    _calEvent.setFirstReminder(firstReminder);
675            }
676    
677            /**
678            * Returns the second reminder of this cal event.
679            *
680            * @return the second reminder of this cal event
681            */
682            public int getSecondReminder() {
683                    return _calEvent.getSecondReminder();
684            }
685    
686            /**
687            * Sets the second reminder of this cal event.
688            *
689            * @param secondReminder the second reminder of this cal event
690            */
691            public void setSecondReminder(int secondReminder) {
692                    _calEvent.setSecondReminder(secondReminder);
693            }
694    
695            public boolean isNew() {
696                    return _calEvent.isNew();
697            }
698    
699            public void setNew(boolean n) {
700                    _calEvent.setNew(n);
701            }
702    
703            public boolean isCachedModel() {
704                    return _calEvent.isCachedModel();
705            }
706    
707            public void setCachedModel(boolean cachedModel) {
708                    _calEvent.setCachedModel(cachedModel);
709            }
710    
711            public boolean isEscapedModel() {
712                    return _calEvent.isEscapedModel();
713            }
714    
715            public java.io.Serializable getPrimaryKeyObj() {
716                    return _calEvent.getPrimaryKeyObj();
717            }
718    
719            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
720                    _calEvent.setPrimaryKeyObj(primaryKeyObj);
721            }
722    
723            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
724                    return _calEvent.getExpandoBridge();
725            }
726    
727            public void setExpandoBridgeAttributes(
728                    com.liferay.portal.service.ServiceContext serviceContext) {
729                    _calEvent.setExpandoBridgeAttributes(serviceContext);
730            }
731    
732            @Override
733            public java.lang.Object clone() {
734                    return new CalEventWrapper((CalEvent)_calEvent.clone());
735            }
736    
737            public int compareTo(com.liferay.portlet.calendar.model.CalEvent calEvent) {
738                    return _calEvent.compareTo(calEvent);
739            }
740    
741            @Override
742            public int hashCode() {
743                    return _calEvent.hashCode();
744            }
745    
746            public com.liferay.portal.model.CacheModel<com.liferay.portlet.calendar.model.CalEvent> toCacheModel() {
747                    return _calEvent.toCacheModel();
748            }
749    
750            public com.liferay.portlet.calendar.model.CalEvent toEscapedModel() {
751                    return new CalEventWrapper(_calEvent.toEscapedModel());
752            }
753    
754            public com.liferay.portlet.calendar.model.CalEvent toUnescapedModel() {
755                    return new CalEventWrapper(_calEvent.toUnescapedModel());
756            }
757    
758            @Override
759            public java.lang.String toString() {
760                    return _calEvent.toString();
761            }
762    
763            public java.lang.String toXmlString() {
764                    return _calEvent.toXmlString();
765            }
766    
767            public void persist()
768                    throws com.liferay.portal.kernel.exception.SystemException {
769                    _calEvent.persist();
770            }
771    
772            public com.liferay.portal.kernel.cal.TZSRecurrence getRecurrenceObj() {
773                    return _calEvent.getRecurrenceObj();
774            }
775    
776            public void setRecurrenceObj(
777                    com.liferay.portal.kernel.cal.TZSRecurrence recurrenceObj) {
778                    _calEvent.setRecurrenceObj(recurrenceObj);
779            }
780    
781            @Override
782            public boolean equals(Object obj) {
783                    if (this == obj) {
784                            return true;
785                    }
786    
787                    if (!(obj instanceof CalEventWrapper)) {
788                            return false;
789                    }
790    
791                    CalEventWrapper calEventWrapper = (CalEventWrapper)obj;
792    
793                    if (Validator.equals(_calEvent, calEventWrapper._calEvent)) {
794                            return true;
795                    }
796    
797                    return false;
798            }
799    
800            /**
801             * @deprecated Renamed to {@link #getWrappedModel}
802             */
803            public CalEvent getWrappedCalEvent() {
804                    return _calEvent;
805            }
806    
807            public CalEvent getWrappedModel() {
808                    return _calEvent;
809            }
810    
811            public void resetOriginalValues() {
812                    _calEvent.resetOriginalValues();
813            }
814    
815            private CalEvent _calEvent;
816    }