001    /**
002     * Copyright (c) 2000-present 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            @Override
134            public java.lang.Object clone() {
135                    return new ShoppingCategoryWrapper((ShoppingCategory)_shoppingCategory.clone());
136            }
137    
138            @Override
139            public int compareTo(
140                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
141                    return _shoppingCategory.compareTo(shoppingCategory);
142            }
143    
144            /**
145            * Returns the category ID of this shopping category.
146            *
147            * @return the category ID of this shopping category
148            */
149            @Override
150            public long getCategoryId() {
151                    return _shoppingCategory.getCategoryId();
152            }
153    
154            /**
155            * Returns the company ID of this shopping category.
156            *
157            * @return the company ID of this shopping category
158            */
159            @Override
160            public long getCompanyId() {
161                    return _shoppingCategory.getCompanyId();
162            }
163    
164            /**
165            * Returns the create date of this shopping category.
166            *
167            * @return the create date of this shopping category
168            */
169            @Override
170            public Date getCreateDate() {
171                    return _shoppingCategory.getCreateDate();
172            }
173    
174            /**
175            * Returns the description of this shopping category.
176            *
177            * @return the description of this shopping category
178            */
179            @Override
180            public java.lang.String getDescription() {
181                    return _shoppingCategory.getDescription();
182            }
183    
184            @Override
185            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
186                    return _shoppingCategory.getExpandoBridge();
187            }
188    
189            /**
190            * Returns the group ID of this shopping category.
191            *
192            * @return the group ID of this shopping category
193            */
194            @Override
195            public long getGroupId() {
196                    return _shoppingCategory.getGroupId();
197            }
198    
199            /**
200            * Returns the modified date of this shopping category.
201            *
202            * @return the modified date of this shopping category
203            */
204            @Override
205            public Date getModifiedDate() {
206                    return _shoppingCategory.getModifiedDate();
207            }
208    
209            /**
210            * Returns the name of this shopping category.
211            *
212            * @return the name of this shopping category
213            */
214            @Override
215            public java.lang.String getName() {
216                    return _shoppingCategory.getName();
217            }
218    
219            /**
220            * Returns the parent category ID of this shopping category.
221            *
222            * @return the parent category ID of this shopping category
223            */
224            @Override
225            public long getParentCategoryId() {
226                    return _shoppingCategory.getParentCategoryId();
227            }
228    
229            /**
230            * Returns the primary key of this shopping category.
231            *
232            * @return the primary key of this shopping category
233            */
234            @Override
235            public long getPrimaryKey() {
236                    return _shoppingCategory.getPrimaryKey();
237            }
238    
239            @Override
240            public java.io.Serializable getPrimaryKeyObj() {
241                    return _shoppingCategory.getPrimaryKeyObj();
242            }
243    
244            /**
245            * Returns the user ID of this shopping category.
246            *
247            * @return the user ID of this shopping category
248            */
249            @Override
250            public long getUserId() {
251                    return _shoppingCategory.getUserId();
252            }
253    
254            /**
255            * Returns the user name of this shopping category.
256            *
257            * @return the user name of this shopping category
258            */
259            @Override
260            public java.lang.String getUserName() {
261                    return _shoppingCategory.getUserName();
262            }
263    
264            /**
265            * Returns the user uuid of this shopping category.
266            *
267            * @return the user uuid of this shopping category
268            */
269            @Override
270            public java.lang.String getUserUuid() {
271                    return _shoppingCategory.getUserUuid();
272            }
273    
274            @Override
275            public int hashCode() {
276                    return _shoppingCategory.hashCode();
277            }
278    
279            @Override
280            public boolean isCachedModel() {
281                    return _shoppingCategory.isCachedModel();
282            }
283    
284            @Override
285            public boolean isEscapedModel() {
286                    return _shoppingCategory.isEscapedModel();
287            }
288    
289            @Override
290            public boolean isNew() {
291                    return _shoppingCategory.isNew();
292            }
293    
294            @Override
295            public boolean isRoot() {
296                    return _shoppingCategory.isRoot();
297            }
298    
299            @Override
300            public void persist() {
301                    _shoppingCategory.persist();
302            }
303    
304            @Override
305            public void setCachedModel(boolean cachedModel) {
306                    _shoppingCategory.setCachedModel(cachedModel);
307            }
308    
309            /**
310            * Sets the category ID of this shopping category.
311            *
312            * @param categoryId the category ID of this shopping category
313            */
314            @Override
315            public void setCategoryId(long categoryId) {
316                    _shoppingCategory.setCategoryId(categoryId);
317            }
318    
319            /**
320            * Sets the company ID of this shopping category.
321            *
322            * @param companyId the company ID of this shopping category
323            */
324            @Override
325            public void setCompanyId(long companyId) {
326                    _shoppingCategory.setCompanyId(companyId);
327            }
328    
329            /**
330            * Sets the create date of this shopping category.
331            *
332            * @param createDate the create date of this shopping category
333            */
334            @Override
335            public void setCreateDate(Date createDate) {
336                    _shoppingCategory.setCreateDate(createDate);
337            }
338    
339            /**
340            * Sets the description of this shopping category.
341            *
342            * @param description the description of this shopping category
343            */
344            @Override
345            public void setDescription(java.lang.String description) {
346                    _shoppingCategory.setDescription(description);
347            }
348    
349            @Override
350            public void setExpandoBridgeAttributes(
351                    com.liferay.portal.model.BaseModel<?> baseModel) {
352                    _shoppingCategory.setExpandoBridgeAttributes(baseModel);
353            }
354    
355            @Override
356            public void setExpandoBridgeAttributes(
357                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
358                    _shoppingCategory.setExpandoBridgeAttributes(expandoBridge);
359            }
360    
361            @Override
362            public void setExpandoBridgeAttributes(
363                    com.liferay.portal.service.ServiceContext serviceContext) {
364                    _shoppingCategory.setExpandoBridgeAttributes(serviceContext);
365            }
366    
367            /**
368            * Sets the group ID of this shopping category.
369            *
370            * @param groupId the group ID of this shopping category
371            */
372            @Override
373            public void setGroupId(long groupId) {
374                    _shoppingCategory.setGroupId(groupId);
375            }
376    
377            /**
378            * Sets the modified date of this shopping category.
379            *
380            * @param modifiedDate the modified date of this shopping category
381            */
382            @Override
383            public void setModifiedDate(Date modifiedDate) {
384                    _shoppingCategory.setModifiedDate(modifiedDate);
385            }
386    
387            /**
388            * Sets the name of this shopping category.
389            *
390            * @param name the name of this shopping category
391            */
392            @Override
393            public void setName(java.lang.String name) {
394                    _shoppingCategory.setName(name);
395            }
396    
397            @Override
398            public void setNew(boolean n) {
399                    _shoppingCategory.setNew(n);
400            }
401    
402            /**
403            * Sets the parent category ID of this shopping category.
404            *
405            * @param parentCategoryId the parent category ID of this shopping category
406            */
407            @Override
408            public void setParentCategoryId(long parentCategoryId) {
409                    _shoppingCategory.setParentCategoryId(parentCategoryId);
410            }
411    
412            /**
413            * Sets the primary key of this shopping category.
414            *
415            * @param primaryKey the primary key of this shopping category
416            */
417            @Override
418            public void setPrimaryKey(long primaryKey) {
419                    _shoppingCategory.setPrimaryKey(primaryKey);
420            }
421    
422            @Override
423            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
424                    _shoppingCategory.setPrimaryKeyObj(primaryKeyObj);
425            }
426    
427            /**
428            * Sets the user ID of this shopping category.
429            *
430            * @param userId the user ID of this shopping category
431            */
432            @Override
433            public void setUserId(long userId) {
434                    _shoppingCategory.setUserId(userId);
435            }
436    
437            /**
438            * Sets the user name of this shopping category.
439            *
440            * @param userName the user name of this shopping category
441            */
442            @Override
443            public void setUserName(java.lang.String userName) {
444                    _shoppingCategory.setUserName(userName);
445            }
446    
447            /**
448            * Sets the user uuid of this shopping category.
449            *
450            * @param userUuid the user uuid of this shopping category
451            */
452            @Override
453            public void setUserUuid(java.lang.String userUuid) {
454                    _shoppingCategory.setUserUuid(userUuid);
455            }
456    
457            @Override
458            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCategory> toCacheModel() {
459                    return _shoppingCategory.toCacheModel();
460            }
461    
462            @Override
463            public com.liferay.portlet.shopping.model.ShoppingCategory toEscapedModel() {
464                    return new ShoppingCategoryWrapper(_shoppingCategory.toEscapedModel());
465            }
466    
467            @Override
468            public java.lang.String toString() {
469                    return _shoppingCategory.toString();
470            }
471    
472            @Override
473            public com.liferay.portlet.shopping.model.ShoppingCategory toUnescapedModel() {
474                    return new ShoppingCategoryWrapper(_shoppingCategory.toUnescapedModel());
475            }
476    
477            @Override
478            public java.lang.String toXmlString() {
479                    return _shoppingCategory.toXmlString();
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            @Deprecated
506            public ShoppingCategory getWrappedShoppingCategory() {
507                    return _shoppingCategory;
508            }
509    
510            @Override
511            public ShoppingCategory getWrappedModel() {
512                    return _shoppingCategory;
513            }
514    
515            @Override
516            public boolean isEntityCacheEnabled() {
517                    return _shoppingCategory.isEntityCacheEnabled();
518            }
519    
520            @Override
521            public boolean isFinderCacheEnabled() {
522                    return _shoppingCategory.isFinderCacheEnabled();
523            }
524    
525            @Override
526            public void resetOriginalValues() {
527                    _shoppingCategory.resetOriginalValues();
528            }
529    
530            private final ShoppingCategory _shoppingCategory;
531    }