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 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            /**
184            * Returns the primary key of this announcements entry.
185            *
186            * @return the primary key of this announcements entry
187            */
188            @Override
189            public long getPrimaryKey() {
190                    return _announcementsEntry.getPrimaryKey();
191            }
192    
193            /**
194            * Sets the primary key of this announcements entry.
195            *
196            * @param primaryKey the primary key of this announcements entry
197            */
198            @Override
199            public void setPrimaryKey(long primaryKey) {
200                    _announcementsEntry.setPrimaryKey(primaryKey);
201            }
202    
203            /**
204            * Returns the uuid of this announcements entry.
205            *
206            * @return the uuid of this announcements entry
207            */
208            @Override
209            public java.lang.String getUuid() {
210                    return _announcementsEntry.getUuid();
211            }
212    
213            /**
214            * Sets the uuid of this announcements entry.
215            *
216            * @param uuid the uuid of this announcements entry
217            */
218            @Override
219            public void setUuid(java.lang.String uuid) {
220                    _announcementsEntry.setUuid(uuid);
221            }
222    
223            /**
224            * Returns the entry ID of this announcements entry.
225            *
226            * @return the entry ID of this announcements entry
227            */
228            @Override
229            public long getEntryId() {
230                    return _announcementsEntry.getEntryId();
231            }
232    
233            /**
234            * Sets the entry ID of this announcements entry.
235            *
236            * @param entryId the entry ID of this announcements entry
237            */
238            @Override
239            public void setEntryId(long entryId) {
240                    _announcementsEntry.setEntryId(entryId);
241            }
242    
243            /**
244            * Returns the company ID of this announcements entry.
245            *
246            * @return the company ID of this announcements entry
247            */
248            @Override
249            public long getCompanyId() {
250                    return _announcementsEntry.getCompanyId();
251            }
252    
253            /**
254            * Sets the company ID of this announcements entry.
255            *
256            * @param companyId the company ID of this announcements entry
257            */
258            @Override
259            public void setCompanyId(long companyId) {
260                    _announcementsEntry.setCompanyId(companyId);
261            }
262    
263            /**
264            * Returns the user ID of this announcements entry.
265            *
266            * @return the user ID of this announcements entry
267            */
268            @Override
269            public long getUserId() {
270                    return _announcementsEntry.getUserId();
271            }
272    
273            /**
274            * Sets the user ID of this announcements entry.
275            *
276            * @param userId the user ID of this announcements entry
277            */
278            @Override
279            public void setUserId(long userId) {
280                    _announcementsEntry.setUserId(userId);
281            }
282    
283            /**
284            * Returns the user uuid of this announcements entry.
285            *
286            * @return the user uuid of this announcements entry
287            * @throws SystemException if a system exception occurred
288            */
289            @Override
290            public java.lang.String getUserUuid()
291                    throws com.liferay.portal.kernel.exception.SystemException {
292                    return _announcementsEntry.getUserUuid();
293            }
294    
295            /**
296            * Sets the user uuid of this announcements entry.
297            *
298            * @param userUuid the user uuid of this announcements entry
299            */
300            @Override
301            public void setUserUuid(java.lang.String userUuid) {
302                    _announcementsEntry.setUserUuid(userUuid);
303            }
304    
305            /**
306            * Returns the user name of this announcements entry.
307            *
308            * @return the user name of this announcements entry
309            */
310            @Override
311            public java.lang.String getUserName() {
312                    return _announcementsEntry.getUserName();
313            }
314    
315            /**
316            * Sets the user name of this announcements entry.
317            *
318            * @param userName the user name of this announcements entry
319            */
320            @Override
321            public void setUserName(java.lang.String userName) {
322                    _announcementsEntry.setUserName(userName);
323            }
324    
325            /**
326            * Returns the create date of this announcements entry.
327            *
328            * @return the create date of this announcements entry
329            */
330            @Override
331            public java.util.Date getCreateDate() {
332                    return _announcementsEntry.getCreateDate();
333            }
334    
335            /**
336            * Sets the create date of this announcements entry.
337            *
338            * @param createDate the create date of this announcements entry
339            */
340            @Override
341            public void setCreateDate(java.util.Date createDate) {
342                    _announcementsEntry.setCreateDate(createDate);
343            }
344    
345            /**
346            * Returns the modified date of this announcements entry.
347            *
348            * @return the modified date of this announcements entry
349            */
350            @Override
351            public java.util.Date getModifiedDate() {
352                    return _announcementsEntry.getModifiedDate();
353            }
354    
355            /**
356            * Sets the modified date of this announcements entry.
357            *
358            * @param modifiedDate the modified date of this announcements entry
359            */
360            @Override
361            public void setModifiedDate(java.util.Date modifiedDate) {
362                    _announcementsEntry.setModifiedDate(modifiedDate);
363            }
364    
365            /**
366            * Returns the fully qualified class name of this announcements entry.
367            *
368            * @return the fully qualified class name of this announcements entry
369            */
370            @Override
371            public java.lang.String getClassName() {
372                    return _announcementsEntry.getClassName();
373            }
374    
375            @Override
376            public void setClassName(java.lang.String className) {
377                    _announcementsEntry.setClassName(className);
378            }
379    
380            /**
381            * Returns the class name ID of this announcements entry.
382            *
383            * @return the class name ID of this announcements entry
384            */
385            @Override
386            public long getClassNameId() {
387                    return _announcementsEntry.getClassNameId();
388            }
389    
390            /**
391            * Sets the class name ID of this announcements entry.
392            *
393            * @param classNameId the class name ID of this announcements entry
394            */
395            @Override
396            public void setClassNameId(long classNameId) {
397                    _announcementsEntry.setClassNameId(classNameId);
398            }
399    
400            /**
401            * Returns the class p k of this announcements entry.
402            *
403            * @return the class p k of this announcements entry
404            */
405            @Override
406            public long getClassPK() {
407                    return _announcementsEntry.getClassPK();
408            }
409    
410            /**
411            * Sets the class p k of this announcements entry.
412            *
413            * @param classPK the class p k of this announcements entry
414            */
415            @Override
416            public void setClassPK(long classPK) {
417                    _announcementsEntry.setClassPK(classPK);
418            }
419    
420            /**
421            * Returns the title of this announcements entry.
422            *
423            * @return the title of this announcements entry
424            */
425            @Override
426            public java.lang.String getTitle() {
427                    return _announcementsEntry.getTitle();
428            }
429    
430            /**
431            * Sets the title of this announcements entry.
432            *
433            * @param title the title of this announcements entry
434            */
435            @Override
436            public void setTitle(java.lang.String title) {
437                    _announcementsEntry.setTitle(title);
438            }
439    
440            /**
441            * Returns the content of this announcements entry.
442            *
443            * @return the content of this announcements entry
444            */
445            @Override
446            public java.lang.String getContent() {
447                    return _announcementsEntry.getContent();
448            }
449    
450            /**
451            * Sets the content of this announcements entry.
452            *
453            * @param content the content of this announcements entry
454            */
455            @Override
456            public void setContent(java.lang.String content) {
457                    _announcementsEntry.setContent(content);
458            }
459    
460            /**
461            * Returns the url of this announcements entry.
462            *
463            * @return the url of this announcements entry
464            */
465            @Override
466            public java.lang.String getUrl() {
467                    return _announcementsEntry.getUrl();
468            }
469    
470            /**
471            * Sets the url of this announcements entry.
472            *
473            * @param url the url of this announcements entry
474            */
475            @Override
476            public void setUrl(java.lang.String url) {
477                    _announcementsEntry.setUrl(url);
478            }
479    
480            /**
481            * Returns the type of this announcements entry.
482            *
483            * @return the type of this announcements entry
484            */
485            @Override
486            public java.lang.String getType() {
487                    return _announcementsEntry.getType();
488            }
489    
490            /**
491            * Sets the type of this announcements entry.
492            *
493            * @param type the type of this announcements entry
494            */
495            @Override
496            public void setType(java.lang.String type) {
497                    _announcementsEntry.setType(type);
498            }
499    
500            /**
501            * Returns the display date of this announcements entry.
502            *
503            * @return the display date of this announcements entry
504            */
505            @Override
506            public java.util.Date getDisplayDate() {
507                    return _announcementsEntry.getDisplayDate();
508            }
509    
510            /**
511            * Sets the display date of this announcements entry.
512            *
513            * @param displayDate the display date of this announcements entry
514            */
515            @Override
516            public void setDisplayDate(java.util.Date displayDate) {
517                    _announcementsEntry.setDisplayDate(displayDate);
518            }
519    
520            /**
521            * Returns the expiration date of this announcements entry.
522            *
523            * @return the expiration date of this announcements entry
524            */
525            @Override
526            public java.util.Date getExpirationDate() {
527                    return _announcementsEntry.getExpirationDate();
528            }
529    
530            /**
531            * Sets the expiration date of this announcements entry.
532            *
533            * @param expirationDate the expiration date of this announcements entry
534            */
535            @Override
536            public void setExpirationDate(java.util.Date expirationDate) {
537                    _announcementsEntry.setExpirationDate(expirationDate);
538            }
539    
540            /**
541            * Returns the priority of this announcements entry.
542            *
543            * @return the priority of this announcements entry
544            */
545            @Override
546            public int getPriority() {
547                    return _announcementsEntry.getPriority();
548            }
549    
550            /**
551            * Sets the priority of this announcements entry.
552            *
553            * @param priority the priority of this announcements entry
554            */
555            @Override
556            public void setPriority(int priority) {
557                    _announcementsEntry.setPriority(priority);
558            }
559    
560            /**
561            * Returns the alert of this announcements entry.
562            *
563            * @return the alert of this announcements entry
564            */
565            @Override
566            public boolean getAlert() {
567                    return _announcementsEntry.getAlert();
568            }
569    
570            /**
571            * Returns <code>true</code> if this announcements entry is alert.
572            *
573            * @return <code>true</code> if this announcements entry is alert; <code>false</code> otherwise
574            */
575            @Override
576            public boolean isAlert() {
577                    return _announcementsEntry.isAlert();
578            }
579    
580            /**
581            * Sets whether this announcements entry is alert.
582            *
583            * @param alert the alert of this announcements entry
584            */
585            @Override
586            public void setAlert(boolean alert) {
587                    _announcementsEntry.setAlert(alert);
588            }
589    
590            @Override
591            public boolean isNew() {
592                    return _announcementsEntry.isNew();
593            }
594    
595            @Override
596            public void setNew(boolean n) {
597                    _announcementsEntry.setNew(n);
598            }
599    
600            @Override
601            public boolean isCachedModel() {
602                    return _announcementsEntry.isCachedModel();
603            }
604    
605            @Override
606            public void setCachedModel(boolean cachedModel) {
607                    _announcementsEntry.setCachedModel(cachedModel);
608            }
609    
610            @Override
611            public boolean isEscapedModel() {
612                    return _announcementsEntry.isEscapedModel();
613            }
614    
615            @Override
616            public java.io.Serializable getPrimaryKeyObj() {
617                    return _announcementsEntry.getPrimaryKeyObj();
618            }
619    
620            @Override
621            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
622                    _announcementsEntry.setPrimaryKeyObj(primaryKeyObj);
623            }
624    
625            @Override
626            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
627                    return _announcementsEntry.getExpandoBridge();
628            }
629    
630            @Override
631            public void setExpandoBridgeAttributes(
632                    com.liferay.portal.model.BaseModel<?> baseModel) {
633                    _announcementsEntry.setExpandoBridgeAttributes(baseModel);
634            }
635    
636            @Override
637            public void setExpandoBridgeAttributes(
638                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
639                    _announcementsEntry.setExpandoBridgeAttributes(expandoBridge);
640            }
641    
642            @Override
643            public void setExpandoBridgeAttributes(
644                    com.liferay.portal.service.ServiceContext serviceContext) {
645                    _announcementsEntry.setExpandoBridgeAttributes(serviceContext);
646            }
647    
648            @Override
649            public java.lang.Object clone() {
650                    return new AnnouncementsEntryWrapper((AnnouncementsEntry)_announcementsEntry.clone());
651            }
652    
653            @Override
654            public int compareTo(
655                    com.liferay.portlet.announcements.model.AnnouncementsEntry announcementsEntry) {
656                    return _announcementsEntry.compareTo(announcementsEntry);
657            }
658    
659            @Override
660            public int hashCode() {
661                    return _announcementsEntry.hashCode();
662            }
663    
664            @Override
665            public com.liferay.portal.model.CacheModel<com.liferay.portlet.announcements.model.AnnouncementsEntry> toCacheModel() {
666                    return _announcementsEntry.toCacheModel();
667            }
668    
669            @Override
670            public com.liferay.portlet.announcements.model.AnnouncementsEntry toEscapedModel() {
671                    return new AnnouncementsEntryWrapper(_announcementsEntry.toEscapedModel());
672            }
673    
674            @Override
675            public com.liferay.portlet.announcements.model.AnnouncementsEntry toUnescapedModel() {
676                    return new AnnouncementsEntryWrapper(_announcementsEntry.toUnescapedModel());
677            }
678    
679            @Override
680            public java.lang.String toString() {
681                    return _announcementsEntry.toString();
682            }
683    
684            @Override
685            public java.lang.String toXmlString() {
686                    return _announcementsEntry.toXmlString();
687            }
688    
689            @Override
690            public void persist()
691                    throws com.liferay.portal.kernel.exception.SystemException {
692                    _announcementsEntry.persist();
693            }
694    
695            @Override
696            public long getGroupId()
697                    throws com.liferay.portal.kernel.exception.PortalException,
698                            com.liferay.portal.kernel.exception.SystemException {
699                    return _announcementsEntry.getGroupId();
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            /**
728             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
729             */
730            public AnnouncementsEntry getWrappedAnnouncementsEntry() {
731                    return _announcementsEntry;
732            }
733    
734            @Override
735            public AnnouncementsEntry getWrappedModel() {
736                    return _announcementsEntry;
737            }
738    
739            @Override
740            public void resetOriginalValues() {
741                    _announcementsEntry.resetOriginalValues();
742            }
743    
744            private AnnouncementsEntry _announcementsEntry;
745    }