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