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.shopping.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 ShoppingCategory}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       ShoppingCategory
031     * @generated
032     */
033    public class ShoppingCategoryWrapper implements ShoppingCategory,
034            ModelWrapper<ShoppingCategory> {
035            public ShoppingCategoryWrapper(ShoppingCategory shoppingCategory) {
036                    _shoppingCategory = shoppingCategory;
037            }
038    
039            public Class<?> getModelClass() {
040                    return ShoppingCategory.class;
041            }
042    
043            public String getModelClassName() {
044                    return ShoppingCategory.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("categoryId", getCategoryId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("createDate", getCreateDate());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("parentCategoryId", getParentCategoryId());
058                    attributes.put("name", getName());
059                    attributes.put("description", getDescription());
060    
061                    return attributes;
062            }
063    
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long categoryId = (Long)attributes.get("categoryId");
066    
067                    if (categoryId != null) {
068                            setCategoryId(categoryId);
069                    }
070    
071                    Long groupId = (Long)attributes.get("groupId");
072    
073                    if (groupId != null) {
074                            setGroupId(groupId);
075                    }
076    
077                    Long companyId = (Long)attributes.get("companyId");
078    
079                    if (companyId != null) {
080                            setCompanyId(companyId);
081                    }
082    
083                    Long userId = (Long)attributes.get("userId");
084    
085                    if (userId != null) {
086                            setUserId(userId);
087                    }
088    
089                    String userName = (String)attributes.get("userName");
090    
091                    if (userName != null) {
092                            setUserName(userName);
093                    }
094    
095                    Date createDate = (Date)attributes.get("createDate");
096    
097                    if (createDate != null) {
098                            setCreateDate(createDate);
099                    }
100    
101                    Date modifiedDate = (Date)attributes.get("modifiedDate");
102    
103                    if (modifiedDate != null) {
104                            setModifiedDate(modifiedDate);
105                    }
106    
107                    Long parentCategoryId = (Long)attributes.get("parentCategoryId");
108    
109                    if (parentCategoryId != null) {
110                            setParentCategoryId(parentCategoryId);
111                    }
112    
113                    String name = (String)attributes.get("name");
114    
115                    if (name != null) {
116                            setName(name);
117                    }
118    
119                    String description = (String)attributes.get("description");
120    
121                    if (description != null) {
122                            setDescription(description);
123                    }
124            }
125    
126            /**
127            * Returns the primary key of this shopping category.
128            *
129            * @return the primary key of this shopping category
130            */
131            public long getPrimaryKey() {
132                    return _shoppingCategory.getPrimaryKey();
133            }
134    
135            /**
136            * Sets the primary key of this shopping category.
137            *
138            * @param primaryKey the primary key of this shopping category
139            */
140            public void setPrimaryKey(long primaryKey) {
141                    _shoppingCategory.setPrimaryKey(primaryKey);
142            }
143    
144            /**
145            * Returns the category ID of this shopping category.
146            *
147            * @return the category ID of this shopping category
148            */
149            public long getCategoryId() {
150                    return _shoppingCategory.getCategoryId();
151            }
152    
153            /**
154            * Sets the category ID of this shopping category.
155            *
156            * @param categoryId the category ID of this shopping category
157            */
158            public void setCategoryId(long categoryId) {
159                    _shoppingCategory.setCategoryId(categoryId);
160            }
161    
162            /**
163            * Returns the group ID of this shopping category.
164            *
165            * @return the group ID of this shopping category
166            */
167            public long getGroupId() {
168                    return _shoppingCategory.getGroupId();
169            }
170    
171            /**
172            * Sets the group ID of this shopping category.
173            *
174            * @param groupId the group ID of this shopping category
175            */
176            public void setGroupId(long groupId) {
177                    _shoppingCategory.setGroupId(groupId);
178            }
179    
180            /**
181            * Returns the company ID of this shopping category.
182            *
183            * @return the company ID of this shopping category
184            */
185            public long getCompanyId() {
186                    return _shoppingCategory.getCompanyId();
187            }
188    
189            /**
190            * Sets the company ID of this shopping category.
191            *
192            * @param companyId the company ID of this shopping category
193            */
194            public void setCompanyId(long companyId) {
195                    _shoppingCategory.setCompanyId(companyId);
196            }
197    
198            /**
199            * Returns the user ID of this shopping category.
200            *
201            * @return the user ID of this shopping category
202            */
203            public long getUserId() {
204                    return _shoppingCategory.getUserId();
205            }
206    
207            /**
208            * Sets the user ID of this shopping category.
209            *
210            * @param userId the user ID of this shopping category
211            */
212            public void setUserId(long userId) {
213                    _shoppingCategory.setUserId(userId);
214            }
215    
216            /**
217            * Returns the user uuid of this shopping category.
218            *
219            * @return the user uuid of this shopping category
220            * @throws SystemException if a system exception occurred
221            */
222            public java.lang.String getUserUuid()
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return _shoppingCategory.getUserUuid();
225            }
226    
227            /**
228            * Sets the user uuid of this shopping category.
229            *
230            * @param userUuid the user uuid of this shopping category
231            */
232            public void setUserUuid(java.lang.String userUuid) {
233                    _shoppingCategory.setUserUuid(userUuid);
234            }
235    
236            /**
237            * Returns the user name of this shopping category.
238            *
239            * @return the user name of this shopping category
240            */
241            public java.lang.String getUserName() {
242                    return _shoppingCategory.getUserName();
243            }
244    
245            /**
246            * Sets the user name of this shopping category.
247            *
248            * @param userName the user name of this shopping category
249            */
250            public void setUserName(java.lang.String userName) {
251                    _shoppingCategory.setUserName(userName);
252            }
253    
254            /**
255            * Returns the create date of this shopping category.
256            *
257            * @return the create date of this shopping category
258            */
259            public java.util.Date getCreateDate() {
260                    return _shoppingCategory.getCreateDate();
261            }
262    
263            /**
264            * Sets the create date of this shopping category.
265            *
266            * @param createDate the create date of this shopping category
267            */
268            public void setCreateDate(java.util.Date createDate) {
269                    _shoppingCategory.setCreateDate(createDate);
270            }
271    
272            /**
273            * Returns the modified date of this shopping category.
274            *
275            * @return the modified date of this shopping category
276            */
277            public java.util.Date getModifiedDate() {
278                    return _shoppingCategory.getModifiedDate();
279            }
280    
281            /**
282            * Sets the modified date of this shopping category.
283            *
284            * @param modifiedDate the modified date of this shopping category
285            */
286            public void setModifiedDate(java.util.Date modifiedDate) {
287                    _shoppingCategory.setModifiedDate(modifiedDate);
288            }
289    
290            /**
291            * Returns the parent category ID of this shopping category.
292            *
293            * @return the parent category ID of this shopping category
294            */
295            public long getParentCategoryId() {
296                    return _shoppingCategory.getParentCategoryId();
297            }
298    
299            /**
300            * Sets the parent category ID of this shopping category.
301            *
302            * @param parentCategoryId the parent category ID of this shopping category
303            */
304            public void setParentCategoryId(long parentCategoryId) {
305                    _shoppingCategory.setParentCategoryId(parentCategoryId);
306            }
307    
308            /**
309            * Returns the name of this shopping category.
310            *
311            * @return the name of this shopping category
312            */
313            public java.lang.String getName() {
314                    return _shoppingCategory.getName();
315            }
316    
317            /**
318            * Sets the name of this shopping category.
319            *
320            * @param name the name of this shopping category
321            */
322            public void setName(java.lang.String name) {
323                    _shoppingCategory.setName(name);
324            }
325    
326            /**
327            * Returns the description of this shopping category.
328            *
329            * @return the description of this shopping category
330            */
331            public java.lang.String getDescription() {
332                    return _shoppingCategory.getDescription();
333            }
334    
335            /**
336            * Sets the description of this shopping category.
337            *
338            * @param description the description of this shopping category
339            */
340            public void setDescription(java.lang.String description) {
341                    _shoppingCategory.setDescription(description);
342            }
343    
344            public boolean isNew() {
345                    return _shoppingCategory.isNew();
346            }
347    
348            public void setNew(boolean n) {
349                    _shoppingCategory.setNew(n);
350            }
351    
352            public boolean isCachedModel() {
353                    return _shoppingCategory.isCachedModel();
354            }
355    
356            public void setCachedModel(boolean cachedModel) {
357                    _shoppingCategory.setCachedModel(cachedModel);
358            }
359    
360            public boolean isEscapedModel() {
361                    return _shoppingCategory.isEscapedModel();
362            }
363    
364            public java.io.Serializable getPrimaryKeyObj() {
365                    return _shoppingCategory.getPrimaryKeyObj();
366            }
367    
368            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
369                    _shoppingCategory.setPrimaryKeyObj(primaryKeyObj);
370            }
371    
372            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
373                    return _shoppingCategory.getExpandoBridge();
374            }
375    
376            public void setExpandoBridgeAttributes(
377                    com.liferay.portal.service.ServiceContext serviceContext) {
378                    _shoppingCategory.setExpandoBridgeAttributes(serviceContext);
379            }
380    
381            @Override
382            public java.lang.Object clone() {
383                    return new ShoppingCategoryWrapper((ShoppingCategory)_shoppingCategory.clone());
384            }
385    
386            public int compareTo(
387                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
388                    return _shoppingCategory.compareTo(shoppingCategory);
389            }
390    
391            @Override
392            public int hashCode() {
393                    return _shoppingCategory.hashCode();
394            }
395    
396            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCategory> toCacheModel() {
397                    return _shoppingCategory.toCacheModel();
398            }
399    
400            public com.liferay.portlet.shopping.model.ShoppingCategory toEscapedModel() {
401                    return new ShoppingCategoryWrapper(_shoppingCategory.toEscapedModel());
402            }
403    
404            public com.liferay.portlet.shopping.model.ShoppingCategory toUnescapedModel() {
405                    return new ShoppingCategoryWrapper(_shoppingCategory.toUnescapedModel());
406            }
407    
408            @Override
409            public java.lang.String toString() {
410                    return _shoppingCategory.toString();
411            }
412    
413            public java.lang.String toXmlString() {
414                    return _shoppingCategory.toXmlString();
415            }
416    
417            public void persist()
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    _shoppingCategory.persist();
420            }
421    
422            public boolean isRoot() {
423                    return _shoppingCategory.isRoot();
424            }
425    
426            @Override
427            public boolean equals(Object obj) {
428                    if (this == obj) {
429                            return true;
430                    }
431    
432                    if (!(obj instanceof ShoppingCategoryWrapper)) {
433                            return false;
434                    }
435    
436                    ShoppingCategoryWrapper shoppingCategoryWrapper = (ShoppingCategoryWrapper)obj;
437    
438                    if (Validator.equals(_shoppingCategory,
439                                            shoppingCategoryWrapper._shoppingCategory)) {
440                            return true;
441                    }
442    
443                    return false;
444            }
445    
446            /**
447             * @deprecated Renamed to {@link #getWrappedModel}
448             */
449            public ShoppingCategory getWrappedShoppingCategory() {
450                    return _shoppingCategory;
451            }
452    
453            public ShoppingCategory getWrappedModel() {
454                    return _shoppingCategory;
455            }
456    
457            public void resetOriginalValues() {
458                    _shoppingCategory.resetOriginalValues();
459            }
460    
461            private ShoppingCategory _shoppingCategory;
462    }