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