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