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