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