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