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