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