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