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.journal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link JournalArticleResource}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       JournalArticleResource
030     * @generated
031     */
032    public class JournalArticleResourceWrapper implements JournalArticleResource,
033            ModelWrapper<JournalArticleResource> {
034            public JournalArticleResourceWrapper(
035                    JournalArticleResource journalArticleResource) {
036                    _journalArticleResource = journalArticleResource;
037            }
038    
039            public Class<?> getModelClass() {
040                    return JournalArticleResource.class;
041            }
042    
043            public String getModelClassName() {
044                    return JournalArticleResource.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("uuid", getUuid());
051                    attributes.put("resourcePrimKey", getResourcePrimKey());
052                    attributes.put("groupId", getGroupId());
053                    attributes.put("articleId", getArticleId());
054    
055                    return attributes;
056            }
057    
058            public void setModelAttributes(Map<String, Object> attributes) {
059                    String uuid = (String)attributes.get("uuid");
060    
061                    if (uuid != null) {
062                            setUuid(uuid);
063                    }
064    
065                    Long resourcePrimKey = (Long)attributes.get("resourcePrimKey");
066    
067                    if (resourcePrimKey != null) {
068                            setResourcePrimKey(resourcePrimKey);
069                    }
070    
071                    Long groupId = (Long)attributes.get("groupId");
072    
073                    if (groupId != null) {
074                            setGroupId(groupId);
075                    }
076    
077                    String articleId = (String)attributes.get("articleId");
078    
079                    if (articleId != null) {
080                            setArticleId(articleId);
081                    }
082            }
083    
084            /**
085            * Returns the primary key of this journal article resource.
086            *
087            * @return the primary key of this journal article resource
088            */
089            public long getPrimaryKey() {
090                    return _journalArticleResource.getPrimaryKey();
091            }
092    
093            /**
094            * Sets the primary key of this journal article resource.
095            *
096            * @param primaryKey the primary key of this journal article resource
097            */
098            public void setPrimaryKey(long primaryKey) {
099                    _journalArticleResource.setPrimaryKey(primaryKey);
100            }
101    
102            /**
103            * Returns the uuid of this journal article resource.
104            *
105            * @return the uuid of this journal article resource
106            */
107            public java.lang.String getUuid() {
108                    return _journalArticleResource.getUuid();
109            }
110    
111            /**
112            * Sets the uuid of this journal article resource.
113            *
114            * @param uuid the uuid of this journal article resource
115            */
116            public void setUuid(java.lang.String uuid) {
117                    _journalArticleResource.setUuid(uuid);
118            }
119    
120            /**
121            * Returns the resource prim key of this journal article resource.
122            *
123            * @return the resource prim key of this journal article resource
124            */
125            public long getResourcePrimKey() {
126                    return _journalArticleResource.getResourcePrimKey();
127            }
128    
129            /**
130            * Sets the resource prim key of this journal article resource.
131            *
132            * @param resourcePrimKey the resource prim key of this journal article resource
133            */
134            public void setResourcePrimKey(long resourcePrimKey) {
135                    _journalArticleResource.setResourcePrimKey(resourcePrimKey);
136            }
137    
138            /**
139            * Returns the group ID of this journal article resource.
140            *
141            * @return the group ID of this journal article resource
142            */
143            public long getGroupId() {
144                    return _journalArticleResource.getGroupId();
145            }
146    
147            /**
148            * Sets the group ID of this journal article resource.
149            *
150            * @param groupId the group ID of this journal article resource
151            */
152            public void setGroupId(long groupId) {
153                    _journalArticleResource.setGroupId(groupId);
154            }
155    
156            /**
157            * Returns the article ID of this journal article resource.
158            *
159            * @return the article ID of this journal article resource
160            */
161            public java.lang.String getArticleId() {
162                    return _journalArticleResource.getArticleId();
163            }
164    
165            /**
166            * Sets the article ID of this journal article resource.
167            *
168            * @param articleId the article ID of this journal article resource
169            */
170            public void setArticleId(java.lang.String articleId) {
171                    _journalArticleResource.setArticleId(articleId);
172            }
173    
174            public boolean isNew() {
175                    return _journalArticleResource.isNew();
176            }
177    
178            public void setNew(boolean n) {
179                    _journalArticleResource.setNew(n);
180            }
181    
182            public boolean isCachedModel() {
183                    return _journalArticleResource.isCachedModel();
184            }
185    
186            public void setCachedModel(boolean cachedModel) {
187                    _journalArticleResource.setCachedModel(cachedModel);
188            }
189    
190            public boolean isEscapedModel() {
191                    return _journalArticleResource.isEscapedModel();
192            }
193    
194            public java.io.Serializable getPrimaryKeyObj() {
195                    return _journalArticleResource.getPrimaryKeyObj();
196            }
197    
198            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
199                    _journalArticleResource.setPrimaryKeyObj(primaryKeyObj);
200            }
201    
202            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
203                    return _journalArticleResource.getExpandoBridge();
204            }
205    
206            public void setExpandoBridgeAttributes(
207                    com.liferay.portal.service.ServiceContext serviceContext) {
208                    _journalArticleResource.setExpandoBridgeAttributes(serviceContext);
209            }
210    
211            @Override
212            public java.lang.Object clone() {
213                    return new JournalArticleResourceWrapper((JournalArticleResource)_journalArticleResource.clone());
214            }
215    
216            public int compareTo(
217                    com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource) {
218                    return _journalArticleResource.compareTo(journalArticleResource);
219            }
220    
221            @Override
222            public int hashCode() {
223                    return _journalArticleResource.hashCode();
224            }
225    
226            public com.liferay.portal.model.CacheModel<com.liferay.portlet.journal.model.JournalArticleResource> toCacheModel() {
227                    return _journalArticleResource.toCacheModel();
228            }
229    
230            public com.liferay.portlet.journal.model.JournalArticleResource toEscapedModel() {
231                    return new JournalArticleResourceWrapper(_journalArticleResource.toEscapedModel());
232            }
233    
234            public com.liferay.portlet.journal.model.JournalArticleResource toUnescapedModel() {
235                    return new JournalArticleResourceWrapper(_journalArticleResource.toUnescapedModel());
236            }
237    
238            @Override
239            public java.lang.String toString() {
240                    return _journalArticleResource.toString();
241            }
242    
243            public java.lang.String toXmlString() {
244                    return _journalArticleResource.toXmlString();
245            }
246    
247            public void persist()
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    _journalArticleResource.persist();
250            }
251    
252            @Override
253            public boolean equals(Object obj) {
254                    if (this == obj) {
255                            return true;
256                    }
257    
258                    if (!(obj instanceof JournalArticleResourceWrapper)) {
259                            return false;
260                    }
261    
262                    JournalArticleResourceWrapper journalArticleResourceWrapper = (JournalArticleResourceWrapper)obj;
263    
264                    if (Validator.equals(_journalArticleResource,
265                                            journalArticleResourceWrapper._journalArticleResource)) {
266                            return true;
267                    }
268    
269                    return false;
270            }
271    
272            /**
273             * @deprecated Renamed to {@link #getWrappedModel}
274             */
275            public JournalArticleResource getWrappedJournalArticleResource() {
276                    return _journalArticleResource;
277            }
278    
279            public JournalArticleResource getWrappedModel() {
280                    return _journalArticleResource;
281            }
282    
283            public void resetOriginalValues() {
284                    _journalArticleResource.resetOriginalValues();
285            }
286    
287            private JournalArticleResource _journalArticleResource;
288    }