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