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.util.Validator;
020    import com.liferay.portal.model.ModelWrapper;
021    
022    import java.util.Date;
023    import java.util.HashMap;
024    import java.util.Map;
025    
026    /**
027     * <p>
028     * This class is a wrapper for {@link AnnouncementsFlag}.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see AnnouncementsFlag
033     * @generated
034     */
035    @ProviderType
036    public class AnnouncementsFlagWrapper implements AnnouncementsFlag,
037            ModelWrapper<AnnouncementsFlag> {
038            public AnnouncementsFlagWrapper(AnnouncementsFlag announcementsFlag) {
039                    _announcementsFlag = announcementsFlag;
040            }
041    
042            @Override
043            public Class<?> getModelClass() {
044                    return AnnouncementsFlag.class;
045            }
046    
047            @Override
048            public String getModelClassName() {
049                    return AnnouncementsFlag.class.getName();
050            }
051    
052            @Override
053            public Map<String, Object> getModelAttributes() {
054                    Map<String, Object> attributes = new HashMap<String, Object>();
055    
056                    attributes.put("flagId", getFlagId());
057                    attributes.put("userId", getUserId());
058                    attributes.put("createDate", getCreateDate());
059                    attributes.put("entryId", getEntryId());
060                    attributes.put("value", getValue());
061    
062                    return attributes;
063            }
064    
065            @Override
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    Long flagId = (Long)attributes.get("flagId");
068    
069                    if (flagId != null) {
070                            setFlagId(flagId);
071                    }
072    
073                    Long userId = (Long)attributes.get("userId");
074    
075                    if (userId != null) {
076                            setUserId(userId);
077                    }
078    
079                    Date createDate = (Date)attributes.get("createDate");
080    
081                    if (createDate != null) {
082                            setCreateDate(createDate);
083                    }
084    
085                    Long entryId = (Long)attributes.get("entryId");
086    
087                    if (entryId != null) {
088                            setEntryId(entryId);
089                    }
090    
091                    Integer value = (Integer)attributes.get("value");
092    
093                    if (value != null) {
094                            setValue(value);
095                    }
096            }
097    
098            /**
099            * Returns the primary key of this announcements flag.
100            *
101            * @return the primary key of this announcements flag
102            */
103            @Override
104            public long getPrimaryKey() {
105                    return _announcementsFlag.getPrimaryKey();
106            }
107    
108            /**
109            * Sets the primary key of this announcements flag.
110            *
111            * @param primaryKey the primary key of this announcements flag
112            */
113            @Override
114            public void setPrimaryKey(long primaryKey) {
115                    _announcementsFlag.setPrimaryKey(primaryKey);
116            }
117    
118            /**
119            * Returns the flag ID of this announcements flag.
120            *
121            * @return the flag ID of this announcements flag
122            */
123            @Override
124            public long getFlagId() {
125                    return _announcementsFlag.getFlagId();
126            }
127    
128            /**
129            * Sets the flag ID of this announcements flag.
130            *
131            * @param flagId the flag ID of this announcements flag
132            */
133            @Override
134            public void setFlagId(long flagId) {
135                    _announcementsFlag.setFlagId(flagId);
136            }
137    
138            /**
139            * Returns the user ID of this announcements flag.
140            *
141            * @return the user ID of this announcements flag
142            */
143            @Override
144            public long getUserId() {
145                    return _announcementsFlag.getUserId();
146            }
147    
148            /**
149            * Sets the user ID of this announcements flag.
150            *
151            * @param userId the user ID of this announcements flag
152            */
153            @Override
154            public void setUserId(long userId) {
155                    _announcementsFlag.setUserId(userId);
156            }
157    
158            /**
159            * Returns the user uuid of this announcements flag.
160            *
161            * @return the user uuid of this announcements flag
162            * @throws SystemException if a system exception occurred
163            */
164            @Override
165            public java.lang.String getUserUuid()
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    return _announcementsFlag.getUserUuid();
168            }
169    
170            /**
171            * Sets the user uuid of this announcements flag.
172            *
173            * @param userUuid the user uuid of this announcements flag
174            */
175            @Override
176            public void setUserUuid(java.lang.String userUuid) {
177                    _announcementsFlag.setUserUuid(userUuid);
178            }
179    
180            /**
181            * Returns the create date of this announcements flag.
182            *
183            * @return the create date of this announcements flag
184            */
185            @Override
186            public java.util.Date getCreateDate() {
187                    return _announcementsFlag.getCreateDate();
188            }
189    
190            /**
191            * Sets the create date of this announcements flag.
192            *
193            * @param createDate the create date of this announcements flag
194            */
195            @Override
196            public void setCreateDate(java.util.Date createDate) {
197                    _announcementsFlag.setCreateDate(createDate);
198            }
199    
200            /**
201            * Returns the entry ID of this announcements flag.
202            *
203            * @return the entry ID of this announcements flag
204            */
205            @Override
206            public long getEntryId() {
207                    return _announcementsFlag.getEntryId();
208            }
209    
210            /**
211            * Sets the entry ID of this announcements flag.
212            *
213            * @param entryId the entry ID of this announcements flag
214            */
215            @Override
216            public void setEntryId(long entryId) {
217                    _announcementsFlag.setEntryId(entryId);
218            }
219    
220            /**
221            * Returns the value of this announcements flag.
222            *
223            * @return the value of this announcements flag
224            */
225            @Override
226            public int getValue() {
227                    return _announcementsFlag.getValue();
228            }
229    
230            /**
231            * Sets the value of this announcements flag.
232            *
233            * @param value the value of this announcements flag
234            */
235            @Override
236            public void setValue(int value) {
237                    _announcementsFlag.setValue(value);
238            }
239    
240            @Override
241            public boolean isNew() {
242                    return _announcementsFlag.isNew();
243            }
244    
245            @Override
246            public void setNew(boolean n) {
247                    _announcementsFlag.setNew(n);
248            }
249    
250            @Override
251            public boolean isCachedModel() {
252                    return _announcementsFlag.isCachedModel();
253            }
254    
255            @Override
256            public void setCachedModel(boolean cachedModel) {
257                    _announcementsFlag.setCachedModel(cachedModel);
258            }
259    
260            @Override
261            public boolean isEscapedModel() {
262                    return _announcementsFlag.isEscapedModel();
263            }
264    
265            @Override
266            public java.io.Serializable getPrimaryKeyObj() {
267                    return _announcementsFlag.getPrimaryKeyObj();
268            }
269    
270            @Override
271            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
272                    _announcementsFlag.setPrimaryKeyObj(primaryKeyObj);
273            }
274    
275            @Override
276            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
277                    return _announcementsFlag.getExpandoBridge();
278            }
279    
280            @Override
281            public void setExpandoBridgeAttributes(
282                    com.liferay.portal.model.BaseModel<?> baseModel) {
283                    _announcementsFlag.setExpandoBridgeAttributes(baseModel);
284            }
285    
286            @Override
287            public void setExpandoBridgeAttributes(
288                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
289                    _announcementsFlag.setExpandoBridgeAttributes(expandoBridge);
290            }
291    
292            @Override
293            public void setExpandoBridgeAttributes(
294                    com.liferay.portal.service.ServiceContext serviceContext) {
295                    _announcementsFlag.setExpandoBridgeAttributes(serviceContext);
296            }
297    
298            @Override
299            public java.lang.Object clone() {
300                    return new AnnouncementsFlagWrapper((AnnouncementsFlag)_announcementsFlag.clone());
301            }
302    
303            @Override
304            public int compareTo(
305                    com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag) {
306                    return _announcementsFlag.compareTo(announcementsFlag);
307            }
308    
309            @Override
310            public int hashCode() {
311                    return _announcementsFlag.hashCode();
312            }
313    
314            @Override
315            public com.liferay.portal.model.CacheModel<com.liferay.portlet.announcements.model.AnnouncementsFlag> toCacheModel() {
316                    return _announcementsFlag.toCacheModel();
317            }
318    
319            @Override
320            public com.liferay.portlet.announcements.model.AnnouncementsFlag toEscapedModel() {
321                    return new AnnouncementsFlagWrapper(_announcementsFlag.toEscapedModel());
322            }
323    
324            @Override
325            public com.liferay.portlet.announcements.model.AnnouncementsFlag toUnescapedModel() {
326                    return new AnnouncementsFlagWrapper(_announcementsFlag.toUnescapedModel());
327            }
328    
329            @Override
330            public java.lang.String toString() {
331                    return _announcementsFlag.toString();
332            }
333    
334            @Override
335            public java.lang.String toXmlString() {
336                    return _announcementsFlag.toXmlString();
337            }
338    
339            @Override
340            public void persist()
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    _announcementsFlag.persist();
343            }
344    
345            @Override
346            public boolean equals(Object obj) {
347                    if (this == obj) {
348                            return true;
349                    }
350    
351                    if (!(obj instanceof AnnouncementsFlagWrapper)) {
352                            return false;
353                    }
354    
355                    AnnouncementsFlagWrapper announcementsFlagWrapper = (AnnouncementsFlagWrapper)obj;
356    
357                    if (Validator.equals(_announcementsFlag,
358                                            announcementsFlagWrapper._announcementsFlag)) {
359                            return true;
360                    }
361    
362                    return false;
363            }
364    
365            /**
366             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
367             */
368            public AnnouncementsFlag getWrappedAnnouncementsFlag() {
369                    return _announcementsFlag;
370            }
371    
372            @Override
373            public AnnouncementsFlag getWrappedModel() {
374                    return _announcementsFlag;
375            }
376    
377            @Override
378            public void resetOriginalValues() {
379                    _announcementsFlag.resetOriginalValues();
380            }
381    
382            private AnnouncementsFlag _announcementsFlag;
383    }