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