001    /**
002     * Copyright (c) 2000-present 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            @Override
225            public java.lang.Object clone() {
226                    return new CalEventWrapper((CalEvent)_calEvent.clone());
227            }
228    
229            @Override
230            public int compareTo(com.liferay.portlet.calendar.model.CalEvent calEvent) {
231                    return _calEvent.compareTo(calEvent);
232            }
233    
234            /**
235            * Returns the all day of this cal event.
236            *
237            * @return the all day of this cal event
238            */
239            @Override
240            public boolean getAllDay() {
241                    return _calEvent.getAllDay();
242            }
243    
244            /**
245            * Returns the company ID of this cal event.
246            *
247            * @return the company ID of this cal event
248            */
249            @Override
250            public long getCompanyId() {
251                    return _calEvent.getCompanyId();
252            }
253    
254            /**
255            * Returns the create date of this cal event.
256            *
257            * @return the create date of this cal event
258            */
259            @Override
260            public java.util.Date getCreateDate() {
261                    return _calEvent.getCreateDate();
262            }
263    
264            /**
265            * Returns the description of this cal event.
266            *
267            * @return the description of this cal event
268            */
269            @Override
270            public java.lang.String getDescription() {
271                    return _calEvent.getDescription();
272            }
273    
274            /**
275            * Returns the duration hour of this cal event.
276            *
277            * @return the duration hour of this cal event
278            */
279            @Override
280            public int getDurationHour() {
281                    return _calEvent.getDurationHour();
282            }
283    
284            /**
285            * Returns the duration minute of this cal event.
286            *
287            * @return the duration minute of this cal event
288            */
289            @Override
290            public int getDurationMinute() {
291                    return _calEvent.getDurationMinute();
292            }
293    
294            /**
295            * Returns the end date of this cal event.
296            *
297            * @return the end date of this cal event
298            */
299            @Override
300            public java.util.Date getEndDate() {
301                    return _calEvent.getEndDate();
302            }
303    
304            /**
305            * Returns the event ID of this cal event.
306            *
307            * @return the event ID of this cal event
308            */
309            @Override
310            public long getEventId() {
311                    return _calEvent.getEventId();
312            }
313    
314            @Override
315            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
316                    return _calEvent.getExpandoBridge();
317            }
318    
319            /**
320            * Returns the first reminder of this cal event.
321            *
322            * @return the first reminder of this cal event
323            */
324            @Override
325            public int getFirstReminder() {
326                    return _calEvent.getFirstReminder();
327            }
328    
329            /**
330            * Returns the group ID of this cal event.
331            *
332            * @return the group ID of this cal event
333            */
334            @Override
335            public long getGroupId() {
336                    return _calEvent.getGroupId();
337            }
338    
339            /**
340            * Returns the location of this cal event.
341            *
342            * @return the location of this cal event
343            */
344            @Override
345            public java.lang.String getLocation() {
346                    return _calEvent.getLocation();
347            }
348    
349            /**
350            * Returns the modified date of this cal event.
351            *
352            * @return the modified date of this cal event
353            */
354            @Override
355            public java.util.Date getModifiedDate() {
356                    return _calEvent.getModifiedDate();
357            }
358    
359            /**
360            * Returns the primary key of this cal event.
361            *
362            * @return the primary key of this cal event
363            */
364            @Override
365            public long getPrimaryKey() {
366                    return _calEvent.getPrimaryKey();
367            }
368    
369            @Override
370            public java.io.Serializable getPrimaryKeyObj() {
371                    return _calEvent.getPrimaryKeyObj();
372            }
373    
374            /**
375            * Returns the recurrence of this cal event.
376            *
377            * @return the recurrence of this cal event
378            */
379            @Override
380            public java.lang.String getRecurrence() {
381                    return _calEvent.getRecurrence();
382            }
383    
384            @Override
385            public com.liferay.portal.kernel.cal.TZSRecurrence getRecurrenceObj() {
386                    return _calEvent.getRecurrenceObj();
387            }
388    
389            /**
390            * Returns the remind by of this cal event.
391            *
392            * @return the remind by of this cal event
393            */
394            @Override
395            public int getRemindBy() {
396                    return _calEvent.getRemindBy();
397            }
398    
399            /**
400            * Returns the repeating of this cal event.
401            *
402            * @return the repeating of this cal event
403            */
404            @Override
405            public boolean getRepeating() {
406                    return _calEvent.getRepeating();
407            }
408    
409            /**
410            * Returns the second reminder of this cal event.
411            *
412            * @return the second reminder of this cal event
413            */
414            @Override
415            public int getSecondReminder() {
416                    return _calEvent.getSecondReminder();
417            }
418    
419            /**
420            * Returns the start date of this cal event.
421            *
422            * @return the start date of this cal event
423            */
424            @Override
425            public java.util.Date getStartDate() {
426                    return _calEvent.getStartDate();
427            }
428    
429            /**
430            * Returns the time zone sensitive of this cal event.
431            *
432            * @return the time zone sensitive of this cal event
433            */
434            @Override
435            public boolean getTimeZoneSensitive() {
436                    return _calEvent.getTimeZoneSensitive();
437            }
438    
439            /**
440            * Returns the title of this cal event.
441            *
442            * @return the title of this cal event
443            */
444            @Override
445            public java.lang.String getTitle() {
446                    return _calEvent.getTitle();
447            }
448    
449            /**
450            * Returns the type of this cal event.
451            *
452            * @return the type of this cal event
453            */
454            @Override
455            public java.lang.String getType() {
456                    return _calEvent.getType();
457            }
458    
459            /**
460            * Returns the user ID of this cal event.
461            *
462            * @return the user ID of this cal event
463            */
464            @Override
465            public long getUserId() {
466                    return _calEvent.getUserId();
467            }
468    
469            /**
470            * Returns the user name of this cal event.
471            *
472            * @return the user name of this cal event
473            */
474            @Override
475            public java.lang.String getUserName() {
476                    return _calEvent.getUserName();
477            }
478    
479            /**
480            * Returns the user uuid of this cal event.
481            *
482            * @return the user uuid of this cal event
483            */
484            @Override
485            public java.lang.String getUserUuid() {
486                    return _calEvent.getUserUuid();
487            }
488    
489            /**
490            * Returns the uuid of this cal event.
491            *
492            * @return the uuid of this cal event
493            */
494            @Override
495            public java.lang.String getUuid() {
496                    return _calEvent.getUuid();
497            }
498    
499            @Override
500            public int hashCode() {
501                    return _calEvent.hashCode();
502            }
503    
504            /**
505            * Returns <code>true</code> if this cal event is all day.
506            *
507            * @return <code>true</code> if this cal event is all day; <code>false</code> otherwise
508            */
509            @Override
510            public boolean isAllDay() {
511                    return _calEvent.isAllDay();
512            }
513    
514            @Override
515            public boolean isCachedModel() {
516                    return _calEvent.isCachedModel();
517            }
518    
519            @Override
520            public boolean isEscapedModel() {
521                    return _calEvent.isEscapedModel();
522            }
523    
524            @Override
525            public boolean isNew() {
526                    return _calEvent.isNew();
527            }
528    
529            /**
530            * Returns <code>true</code> if this cal event is repeating.
531            *
532            * @return <code>true</code> if this cal event is repeating; <code>false</code> otherwise
533            */
534            @Override
535            public boolean isRepeating() {
536                    return _calEvent.isRepeating();
537            }
538    
539            /**
540            * Returns <code>true</code> if this cal event is time zone sensitive.
541            *
542            * @return <code>true</code> if this cal event is time zone sensitive; <code>false</code> otherwise
543            */
544            @Override
545            public boolean isTimeZoneSensitive() {
546                    return _calEvent.isTimeZoneSensitive();
547            }
548    
549            @Override
550            public void persist() {
551                    _calEvent.persist();
552            }
553    
554            /**
555            * Sets whether this cal event is all day.
556            *
557            * @param allDay the all day of this cal event
558            */
559            @Override
560            public void setAllDay(boolean allDay) {
561                    _calEvent.setAllDay(allDay);
562            }
563    
564            @Override
565            public void setCachedModel(boolean cachedModel) {
566                    _calEvent.setCachedModel(cachedModel);
567            }
568    
569            /**
570            * Sets the company ID of this cal event.
571            *
572            * @param companyId the company ID of this cal event
573            */
574            @Override
575            public void setCompanyId(long companyId) {
576                    _calEvent.setCompanyId(companyId);
577            }
578    
579            /**
580            * Sets the create date of this cal event.
581            *
582            * @param createDate the create date of this cal event
583            */
584            @Override
585            public void setCreateDate(java.util.Date createDate) {
586                    _calEvent.setCreateDate(createDate);
587            }
588    
589            /**
590            * Sets the description of this cal event.
591            *
592            * @param description the description of this cal event
593            */
594            @Override
595            public void setDescription(java.lang.String description) {
596                    _calEvent.setDescription(description);
597            }
598    
599            /**
600            * Sets the duration hour of this cal event.
601            *
602            * @param durationHour the duration hour of this cal event
603            */
604            @Override
605            public void setDurationHour(int durationHour) {
606                    _calEvent.setDurationHour(durationHour);
607            }
608    
609            /**
610            * Sets the duration minute of this cal event.
611            *
612            * @param durationMinute the duration minute of this cal event
613            */
614            @Override
615            public void setDurationMinute(int durationMinute) {
616                    _calEvent.setDurationMinute(durationMinute);
617            }
618    
619            /**
620            * Sets the end date of this cal event.
621            *
622            * @param endDate the end date of this cal event
623            */
624            @Override
625            public void setEndDate(java.util.Date endDate) {
626                    _calEvent.setEndDate(endDate);
627            }
628    
629            /**
630            * Sets the event ID of this cal event.
631            *
632            * @param eventId the event ID of this cal event
633            */
634            @Override
635            public void setEventId(long eventId) {
636                    _calEvent.setEventId(eventId);
637            }
638    
639            @Override
640            public void setExpandoBridgeAttributes(
641                    com.liferay.portal.model.BaseModel<?> baseModel) {
642                    _calEvent.setExpandoBridgeAttributes(baseModel);
643            }
644    
645            @Override
646            public void setExpandoBridgeAttributes(
647                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
648                    _calEvent.setExpandoBridgeAttributes(expandoBridge);
649            }
650    
651            @Override
652            public void setExpandoBridgeAttributes(
653                    com.liferay.portal.service.ServiceContext serviceContext) {
654                    _calEvent.setExpandoBridgeAttributes(serviceContext);
655            }
656    
657            /**
658            * Sets the first reminder of this cal event.
659            *
660            * @param firstReminder the first reminder of this cal event
661            */
662            @Override
663            public void setFirstReminder(int firstReminder) {
664                    _calEvent.setFirstReminder(firstReminder);
665            }
666    
667            /**
668            * Sets the group ID of this cal event.
669            *
670            * @param groupId the group ID of this cal event
671            */
672            @Override
673            public void setGroupId(long groupId) {
674                    _calEvent.setGroupId(groupId);
675            }
676    
677            /**
678            * Sets the location of this cal event.
679            *
680            * @param location the location of this cal event
681            */
682            @Override
683            public void setLocation(java.lang.String location) {
684                    _calEvent.setLocation(location);
685            }
686    
687            /**
688            * Sets the modified date of this cal event.
689            *
690            * @param modifiedDate the modified date of this cal event
691            */
692            @Override
693            public void setModifiedDate(java.util.Date modifiedDate) {
694                    _calEvent.setModifiedDate(modifiedDate);
695            }
696    
697            @Override
698            public void setNew(boolean n) {
699                    _calEvent.setNew(n);
700            }
701    
702            /**
703            * Sets the primary key of this cal event.
704            *
705            * @param primaryKey the primary key of this cal event
706            */
707            @Override
708            public void setPrimaryKey(long primaryKey) {
709                    _calEvent.setPrimaryKey(primaryKey);
710            }
711    
712            @Override
713            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
714                    _calEvent.setPrimaryKeyObj(primaryKeyObj);
715            }
716    
717            /**
718            * Sets the recurrence of this cal event.
719            *
720            * @param recurrence the recurrence of this cal event
721            */
722            @Override
723            public void setRecurrence(java.lang.String recurrence) {
724                    _calEvent.setRecurrence(recurrence);
725            }
726    
727            @Override
728            public void setRecurrenceObj(
729                    com.liferay.portal.kernel.cal.TZSRecurrence recurrenceObj) {
730                    _calEvent.setRecurrenceObj(recurrenceObj);
731            }
732    
733            /**
734            * Sets the remind by of this cal event.
735            *
736            * @param remindBy the remind by of this cal event
737            */
738            @Override
739            public void setRemindBy(int remindBy) {
740                    _calEvent.setRemindBy(remindBy);
741            }
742    
743            /**
744            * Sets whether this cal event is repeating.
745            *
746            * @param repeating the repeating of this cal event
747            */
748            @Override
749            public void setRepeating(boolean repeating) {
750                    _calEvent.setRepeating(repeating);
751            }
752    
753            /**
754            * Sets the second reminder of this cal event.
755            *
756            * @param secondReminder the second reminder of this cal event
757            */
758            @Override
759            public void setSecondReminder(int secondReminder) {
760                    _calEvent.setSecondReminder(secondReminder);
761            }
762    
763            /**
764            * Sets the start date of this cal event.
765            *
766            * @param startDate the start date of this cal event
767            */
768            @Override
769            public void setStartDate(java.util.Date startDate) {
770                    _calEvent.setStartDate(startDate);
771            }
772    
773            /**
774            * Sets whether this cal event is time zone sensitive.
775            *
776            * @param timeZoneSensitive the time zone sensitive of this cal event
777            */
778            @Override
779            public void setTimeZoneSensitive(boolean timeZoneSensitive) {
780                    _calEvent.setTimeZoneSensitive(timeZoneSensitive);
781            }
782    
783            /**
784            * Sets the title of this cal event.
785            *
786            * @param title the title of this cal event
787            */
788            @Override
789            public void setTitle(java.lang.String title) {
790                    _calEvent.setTitle(title);
791            }
792    
793            /**
794            * Sets the type of this cal event.
795            *
796            * @param type the type of this cal event
797            */
798            @Override
799            public void setType(java.lang.String type) {
800                    _calEvent.setType(type);
801            }
802    
803            /**
804            * Sets the user ID of this cal event.
805            *
806            * @param userId the user ID of this cal event
807            */
808            @Override
809            public void setUserId(long userId) {
810                    _calEvent.setUserId(userId);
811            }
812    
813            /**
814            * Sets the user name of this cal event.
815            *
816            * @param userName the user name of this cal event
817            */
818            @Override
819            public void setUserName(java.lang.String userName) {
820                    _calEvent.setUserName(userName);
821            }
822    
823            /**
824            * Sets the user uuid of this cal event.
825            *
826            * @param userUuid the user uuid of this cal event
827            */
828            @Override
829            public void setUserUuid(java.lang.String userUuid) {
830                    _calEvent.setUserUuid(userUuid);
831            }
832    
833            /**
834            * Sets the uuid of this cal event.
835            *
836            * @param uuid the uuid of this cal event
837            */
838            @Override
839            public void setUuid(java.lang.String uuid) {
840                    _calEvent.setUuid(uuid);
841            }
842    
843            @Override
844            public com.liferay.portal.model.CacheModel<com.liferay.portlet.calendar.model.CalEvent> toCacheModel() {
845                    return _calEvent.toCacheModel();
846            }
847    
848            @Override
849            public com.liferay.portlet.calendar.model.CalEvent toEscapedModel() {
850                    return new CalEventWrapper(_calEvent.toEscapedModel());
851            }
852    
853            @Override
854            public java.lang.String toString() {
855                    return _calEvent.toString();
856            }
857    
858            @Override
859            public com.liferay.portlet.calendar.model.CalEvent toUnescapedModel() {
860                    return new CalEventWrapper(_calEvent.toUnescapedModel());
861            }
862    
863            @Override
864            public java.lang.String toXmlString() {
865                    return _calEvent.toXmlString();
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            @Deprecated
896            public CalEvent getWrappedCalEvent() {
897                    return _calEvent;
898            }
899    
900            @Override
901            public CalEvent getWrappedModel() {
902                    return _calEvent;
903            }
904    
905            @Override
906            public boolean isEntityCacheEnabled() {
907                    return _calEvent.isEntityCacheEnabled();
908            }
909    
910            @Override
911            public boolean isFinderCacheEnabled() {
912                    return _calEvent.isFinderCacheEnabled();
913            }
914    
915            @Override
916            public void resetOriginalValues() {
917                    _calEvent.resetOriginalValues();
918            }
919    
920            private final CalEvent _calEvent;
921    }