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.announcements.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.exportimport.kernel.lar.StagedModelType;
022    
023    import com.liferay.portal.kernel.model.ModelWrapper;
024    import com.liferay.portal.kernel.service.ServiceContext;
025    import com.liferay.portal.kernel.util.Validator;
026    
027    import java.io.Serializable;
028    
029    import java.util.Date;
030    import java.util.HashMap;
031    import java.util.Map;
032    
033    /**
034     * <p>
035     * This class is a wrapper for {@link AnnouncementsEntry}.
036     * </p>
037     *
038     * @author Brian Wing Shun Chan
039     * @see AnnouncementsEntry
040     * @generated
041     */
042    @ProviderType
043    public class AnnouncementsEntryWrapper implements AnnouncementsEntry,
044            ModelWrapper<AnnouncementsEntry> {
045            public AnnouncementsEntryWrapper(AnnouncementsEntry announcementsEntry) {
046                    _announcementsEntry = announcementsEntry;
047            }
048    
049            @Override
050            public Class<?> getModelClass() {
051                    return AnnouncementsEntry.class;
052            }
053    
054            @Override
055            public String getModelClassName() {
056                    return AnnouncementsEntry.class.getName();
057            }
058    
059            @Override
060            public Map<String, Object> getModelAttributes() {
061                    Map<String, Object> attributes = new HashMap<String, Object>();
062    
063                    attributes.put("uuid", getUuid());
064                    attributes.put("entryId", getEntryId());
065                    attributes.put("companyId", getCompanyId());
066                    attributes.put("userId", getUserId());
067                    attributes.put("userName", getUserName());
068                    attributes.put("createDate", getCreateDate());
069                    attributes.put("modifiedDate", getModifiedDate());
070                    attributes.put("classNameId", getClassNameId());
071                    attributes.put("classPK", getClassPK());
072                    attributes.put("title", getTitle());
073                    attributes.put("content", getContent());
074                    attributes.put("url", getUrl());
075                    attributes.put("type", getType());
076                    attributes.put("displayDate", getDisplayDate());
077                    attributes.put("expirationDate", getExpirationDate());
078                    attributes.put("priority", getPriority());
079                    attributes.put("alert", getAlert());
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 entryId = (Long)attributes.get("entryId");
093    
094                    if (entryId != null) {
095                            setEntryId(entryId);
096                    }
097    
098                    Long companyId = (Long)attributes.get("companyId");
099    
100                    if (companyId != null) {
101                            setCompanyId(companyId);
102                    }
103    
104                    Long userId = (Long)attributes.get("userId");
105    
106                    if (userId != null) {
107                            setUserId(userId);
108                    }
109    
110                    String userName = (String)attributes.get("userName");
111    
112                    if (userName != null) {
113                            setUserName(userName);
114                    }
115    
116                    Date createDate = (Date)attributes.get("createDate");
117    
118                    if (createDate != null) {
119                            setCreateDate(createDate);
120                    }
121    
122                    Date modifiedDate = (Date)attributes.get("modifiedDate");
123    
124                    if (modifiedDate != null) {
125                            setModifiedDate(modifiedDate);
126                    }
127    
128                    Long classNameId = (Long)attributes.get("classNameId");
129    
130                    if (classNameId != null) {
131                            setClassNameId(classNameId);
132                    }
133    
134                    Long classPK = (Long)attributes.get("classPK");
135    
136                    if (classPK != null) {
137                            setClassPK(classPK);
138                    }
139    
140                    String title = (String)attributes.get("title");
141    
142                    if (title != null) {
143                            setTitle(title);
144                    }
145    
146                    String content = (String)attributes.get("content");
147    
148                    if (content != null) {
149                            setContent(content);
150                    }
151    
152                    String url = (String)attributes.get("url");
153    
154                    if (url != null) {
155                            setUrl(url);
156                    }
157    
158                    String type = (String)attributes.get("type");
159    
160                    if (type != null) {
161                            setType(type);
162                    }
163    
164                    Date displayDate = (Date)attributes.get("displayDate");
165    
166                    if (displayDate != null) {
167                            setDisplayDate(displayDate);
168                    }
169    
170                    Date expirationDate = (Date)attributes.get("expirationDate");
171    
172                    if (expirationDate != null) {
173                            setExpirationDate(expirationDate);
174                    }
175    
176                    Integer priority = (Integer)attributes.get("priority");
177    
178                    if (priority != null) {
179                            setPriority(priority);
180                    }
181    
182                    Boolean alert = (Boolean)attributes.get("alert");
183    
184                    if (alert != null) {
185                            setAlert(alert);
186                    }
187            }
188    
189            @Override
190            public java.lang.Object clone() {
191                    return new AnnouncementsEntryWrapper((AnnouncementsEntry)_announcementsEntry.clone());
192            }
193    
194            @Override
195            public int compareTo(
196                    com.liferay.announcements.kernel.model.AnnouncementsEntry announcementsEntry) {
197                    return _announcementsEntry.compareTo(announcementsEntry);
198            }
199    
200            /**
201            * Returns the alert of this announcements entry.
202            *
203            * @return the alert of this announcements entry
204            */
205            @Override
206            public boolean getAlert() {
207                    return _announcementsEntry.getAlert();
208            }
209    
210            /**
211            * Returns the fully qualified class name of this announcements entry.
212            *
213            * @return the fully qualified class name of this announcements entry
214            */
215            @Override
216            public java.lang.String getClassName() {
217                    return _announcementsEntry.getClassName();
218            }
219    
220            /**
221            * Returns the class name ID of this announcements entry.
222            *
223            * @return the class name ID of this announcements entry
224            */
225            @Override
226            public long getClassNameId() {
227                    return _announcementsEntry.getClassNameId();
228            }
229    
230            /**
231            * Returns the class p k of this announcements entry.
232            *
233            * @return the class p k of this announcements entry
234            */
235            @Override
236            public long getClassPK() {
237                    return _announcementsEntry.getClassPK();
238            }
239    
240            /**
241            * Returns the company ID of this announcements entry.
242            *
243            * @return the company ID of this announcements entry
244            */
245            @Override
246            public long getCompanyId() {
247                    return _announcementsEntry.getCompanyId();
248            }
249    
250            /**
251            * Returns the content of this announcements entry.
252            *
253            * @return the content of this announcements entry
254            */
255            @Override
256            public java.lang.String getContent() {
257                    return _announcementsEntry.getContent();
258            }
259    
260            /**
261            * Returns the create date of this announcements entry.
262            *
263            * @return the create date of this announcements entry
264            */
265            @Override
266            public Date getCreateDate() {
267                    return _announcementsEntry.getCreateDate();
268            }
269    
270            /**
271            * Returns the display date of this announcements entry.
272            *
273            * @return the display date of this announcements entry
274            */
275            @Override
276            public Date getDisplayDate() {
277                    return _announcementsEntry.getDisplayDate();
278            }
279    
280            /**
281            * Returns the entry ID of this announcements entry.
282            *
283            * @return the entry ID of this announcements entry
284            */
285            @Override
286            public long getEntryId() {
287                    return _announcementsEntry.getEntryId();
288            }
289    
290            @Override
291            public ExpandoBridge getExpandoBridge() {
292                    return _announcementsEntry.getExpandoBridge();
293            }
294    
295            /**
296            * Returns the expiration date of this announcements entry.
297            *
298            * @return the expiration date of this announcements entry
299            */
300            @Override
301            public Date getExpirationDate() {
302                    return _announcementsEntry.getExpirationDate();
303            }
304    
305            @Override
306            public long getGroupId()
307                    throws com.liferay.portal.kernel.exception.PortalException {
308                    return _announcementsEntry.getGroupId();
309            }
310    
311            /**
312            * Returns the modified date of this announcements entry.
313            *
314            * @return the modified date of this announcements entry
315            */
316            @Override
317            public Date getModifiedDate() {
318                    return _announcementsEntry.getModifiedDate();
319            }
320    
321            /**
322            * Returns the primary key of this announcements entry.
323            *
324            * @return the primary key of this announcements entry
325            */
326            @Override
327            public long getPrimaryKey() {
328                    return _announcementsEntry.getPrimaryKey();
329            }
330    
331            @Override
332            public Serializable getPrimaryKeyObj() {
333                    return _announcementsEntry.getPrimaryKeyObj();
334            }
335    
336            /**
337            * Returns the priority of this announcements entry.
338            *
339            * @return the priority of this announcements entry
340            */
341            @Override
342            public int getPriority() {
343                    return _announcementsEntry.getPriority();
344            }
345    
346            /**
347            * Returns the title of this announcements entry.
348            *
349            * @return the title of this announcements entry
350            */
351            @Override
352            public java.lang.String getTitle() {
353                    return _announcementsEntry.getTitle();
354            }
355    
356            /**
357            * Returns the type of this announcements entry.
358            *
359            * @return the type of this announcements entry
360            */
361            @Override
362            public java.lang.String getType() {
363                    return _announcementsEntry.getType();
364            }
365    
366            /**
367            * Returns the url of this announcements entry.
368            *
369            * @return the url of this announcements entry
370            */
371            @Override
372            public java.lang.String getUrl() {
373                    return _announcementsEntry.getUrl();
374            }
375    
376            /**
377            * Returns the user ID of this announcements entry.
378            *
379            * @return the user ID of this announcements entry
380            */
381            @Override
382            public long getUserId() {
383                    return _announcementsEntry.getUserId();
384            }
385    
386            /**
387            * Returns the user name of this announcements entry.
388            *
389            * @return the user name of this announcements entry
390            */
391            @Override
392            public java.lang.String getUserName() {
393                    return _announcementsEntry.getUserName();
394            }
395    
396            /**
397            * Returns the user uuid of this announcements entry.
398            *
399            * @return the user uuid of this announcements entry
400            */
401            @Override
402            public java.lang.String getUserUuid() {
403                    return _announcementsEntry.getUserUuid();
404            }
405    
406            /**
407            * Returns the uuid of this announcements entry.
408            *
409            * @return the uuid of this announcements entry
410            */
411            @Override
412            public java.lang.String getUuid() {
413                    return _announcementsEntry.getUuid();
414            }
415    
416            @Override
417            public int hashCode() {
418                    return _announcementsEntry.hashCode();
419            }
420    
421            /**
422            * Returns <code>true</code> if this announcements entry is alert.
423            *
424            * @return <code>true</code> if this announcements entry is alert; <code>false</code> otherwise
425            */
426            @Override
427            public boolean isAlert() {
428                    return _announcementsEntry.isAlert();
429            }
430    
431            @Override
432            public boolean isCachedModel() {
433                    return _announcementsEntry.isCachedModel();
434            }
435    
436            @Override
437            public boolean isEscapedModel() {
438                    return _announcementsEntry.isEscapedModel();
439            }
440    
441            @Override
442            public boolean isNew() {
443                    return _announcementsEntry.isNew();
444            }
445    
446            @Override
447            public void persist() {
448                    _announcementsEntry.persist();
449            }
450    
451            /**
452            * Sets whether this announcements entry is alert.
453            *
454            * @param alert the alert of this announcements entry
455            */
456            @Override
457            public void setAlert(boolean alert) {
458                    _announcementsEntry.setAlert(alert);
459            }
460    
461            @Override
462            public void setCachedModel(boolean cachedModel) {
463                    _announcementsEntry.setCachedModel(cachedModel);
464            }
465    
466            @Override
467            public void setClassName(java.lang.String className) {
468                    _announcementsEntry.setClassName(className);
469            }
470    
471            /**
472            * Sets the class name ID of this announcements entry.
473            *
474            * @param classNameId the class name ID of this announcements entry
475            */
476            @Override
477            public void setClassNameId(long classNameId) {
478                    _announcementsEntry.setClassNameId(classNameId);
479            }
480    
481            /**
482            * Sets the class p k of this announcements entry.
483            *
484            * @param classPK the class p k of this announcements entry
485            */
486            @Override
487            public void setClassPK(long classPK) {
488                    _announcementsEntry.setClassPK(classPK);
489            }
490    
491            /**
492            * Sets the company ID of this announcements entry.
493            *
494            * @param companyId the company ID of this announcements entry
495            */
496            @Override
497            public void setCompanyId(long companyId) {
498                    _announcementsEntry.setCompanyId(companyId);
499            }
500    
501            /**
502            * Sets the content of this announcements entry.
503            *
504            * @param content the content of this announcements entry
505            */
506            @Override
507            public void setContent(java.lang.String content) {
508                    _announcementsEntry.setContent(content);
509            }
510    
511            /**
512            * Sets the create date of this announcements entry.
513            *
514            * @param createDate the create date of this announcements entry
515            */
516            @Override
517            public void setCreateDate(Date createDate) {
518                    _announcementsEntry.setCreateDate(createDate);
519            }
520    
521            /**
522            * Sets the display date of this announcements entry.
523            *
524            * @param displayDate the display date of this announcements entry
525            */
526            @Override
527            public void setDisplayDate(Date displayDate) {
528                    _announcementsEntry.setDisplayDate(displayDate);
529            }
530    
531            /**
532            * Sets the entry ID of this announcements entry.
533            *
534            * @param entryId the entry ID of this announcements entry
535            */
536            @Override
537            public void setEntryId(long entryId) {
538                    _announcementsEntry.setEntryId(entryId);
539            }
540    
541            @Override
542            public void setExpandoBridgeAttributes(
543                    com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
544                    _announcementsEntry.setExpandoBridgeAttributes(baseModel);
545            }
546    
547            @Override
548            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
549                    _announcementsEntry.setExpandoBridgeAttributes(expandoBridge);
550            }
551    
552            @Override
553            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
554                    _announcementsEntry.setExpandoBridgeAttributes(serviceContext);
555            }
556    
557            /**
558            * Sets the expiration date of this announcements entry.
559            *
560            * @param expirationDate the expiration date of this announcements entry
561            */
562            @Override
563            public void setExpirationDate(Date expirationDate) {
564                    _announcementsEntry.setExpirationDate(expirationDate);
565            }
566    
567            /**
568            * Sets the modified date of this announcements entry.
569            *
570            * @param modifiedDate the modified date of this announcements entry
571            */
572            @Override
573            public void setModifiedDate(Date modifiedDate) {
574                    _announcementsEntry.setModifiedDate(modifiedDate);
575            }
576    
577            @Override
578            public void setNew(boolean n) {
579                    _announcementsEntry.setNew(n);
580            }
581    
582            /**
583            * Sets the primary key of this announcements entry.
584            *
585            * @param primaryKey the primary key of this announcements entry
586            */
587            @Override
588            public void setPrimaryKey(long primaryKey) {
589                    _announcementsEntry.setPrimaryKey(primaryKey);
590            }
591    
592            @Override
593            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
594                    _announcementsEntry.setPrimaryKeyObj(primaryKeyObj);
595            }
596    
597            /**
598            * Sets the priority of this announcements entry.
599            *
600            * @param priority the priority of this announcements entry
601            */
602            @Override
603            public void setPriority(int priority) {
604                    _announcementsEntry.setPriority(priority);
605            }
606    
607            /**
608            * Sets the title of this announcements entry.
609            *
610            * @param title the title of this announcements entry
611            */
612            @Override
613            public void setTitle(java.lang.String title) {
614                    _announcementsEntry.setTitle(title);
615            }
616    
617            /**
618            * Sets the type of this announcements entry.
619            *
620            * @param type the type of this announcements entry
621            */
622            @Override
623            public void setType(java.lang.String type) {
624                    _announcementsEntry.setType(type);
625            }
626    
627            /**
628            * Sets the url of this announcements entry.
629            *
630            * @param url the url of this announcements entry
631            */
632            @Override
633            public void setUrl(java.lang.String url) {
634                    _announcementsEntry.setUrl(url);
635            }
636    
637            /**
638            * Sets the user ID of this announcements entry.
639            *
640            * @param userId the user ID of this announcements entry
641            */
642            @Override
643            public void setUserId(long userId) {
644                    _announcementsEntry.setUserId(userId);
645            }
646    
647            /**
648            * Sets the user name of this announcements entry.
649            *
650            * @param userName the user name of this announcements entry
651            */
652            @Override
653            public void setUserName(java.lang.String userName) {
654                    _announcementsEntry.setUserName(userName);
655            }
656    
657            /**
658            * Sets the user uuid of this announcements entry.
659            *
660            * @param userUuid the user uuid of this announcements entry
661            */
662            @Override
663            public void setUserUuid(java.lang.String userUuid) {
664                    _announcementsEntry.setUserUuid(userUuid);
665            }
666    
667            /**
668            * Sets the uuid of this announcements entry.
669            *
670            * @param uuid the uuid of this announcements entry
671            */
672            @Override
673            public void setUuid(java.lang.String uuid) {
674                    _announcementsEntry.setUuid(uuid);
675            }
676    
677            @Override
678            public com.liferay.portal.kernel.model.CacheModel<com.liferay.announcements.kernel.model.AnnouncementsEntry> toCacheModel() {
679                    return _announcementsEntry.toCacheModel();
680            }
681    
682            @Override
683            public com.liferay.announcements.kernel.model.AnnouncementsEntry toEscapedModel() {
684                    return new AnnouncementsEntryWrapper(_announcementsEntry.toEscapedModel());
685            }
686    
687            @Override
688            public java.lang.String toString() {
689                    return _announcementsEntry.toString();
690            }
691    
692            @Override
693            public com.liferay.announcements.kernel.model.AnnouncementsEntry toUnescapedModel() {
694                    return new AnnouncementsEntryWrapper(_announcementsEntry.toUnescapedModel());
695            }
696    
697            @Override
698            public java.lang.String toXmlString() {
699                    return _announcementsEntry.toXmlString();
700            }
701    
702            @Override
703            public boolean equals(Object obj) {
704                    if (this == obj) {
705                            return true;
706                    }
707    
708                    if (!(obj instanceof AnnouncementsEntryWrapper)) {
709                            return false;
710                    }
711    
712                    AnnouncementsEntryWrapper announcementsEntryWrapper = (AnnouncementsEntryWrapper)obj;
713    
714                    if (Validator.equals(_announcementsEntry,
715                                            announcementsEntryWrapper._announcementsEntry)) {
716                            return true;
717                    }
718    
719                    return false;
720            }
721    
722            @Override
723            public StagedModelType getStagedModelType() {
724                    return _announcementsEntry.getStagedModelType();
725            }
726    
727            @Override
728            public AnnouncementsEntry getWrappedModel() {
729                    return _announcementsEntry;
730            }
731    
732            @Override
733            public boolean isEntityCacheEnabled() {
734                    return _announcementsEntry.isEntityCacheEnabled();
735            }
736    
737            @Override
738            public boolean isFinderCacheEnabled() {
739                    return _announcementsEntry.isFinderCacheEnabled();
740            }
741    
742            @Override
743            public void resetOriginalValues() {
744                    _announcementsEntry.resetOriginalValues();
745            }
746    
747            private final AnnouncementsEntry _announcementsEntry;
748    }