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