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