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.dynamicdatalists.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 DDLRecord}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       DDLRecord
031     * @generated
032     */
033    public class DDLRecordWrapper implements DDLRecord, ModelWrapper<DDLRecord> {
034            public DDLRecordWrapper(DDLRecord ddlRecord) {
035                    _ddlRecord = ddlRecord;
036            }
037    
038            public Class<?> getModelClass() {
039                    return DDLRecord.class;
040            }
041    
042            public String getModelClassName() {
043                    return DDLRecord.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("recordId", getRecordId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("versionUserId", getVersionUserId());
056                    attributes.put("versionUserName", getVersionUserName());
057                    attributes.put("createDate", getCreateDate());
058                    attributes.put("modifiedDate", getModifiedDate());
059                    attributes.put("DDMStorageId", getDDMStorageId());
060                    attributes.put("recordSetId", getRecordSetId());
061                    attributes.put("version", getVersion());
062                    attributes.put("displayIndex", getDisplayIndex());
063    
064                    return attributes;
065            }
066    
067            public void setModelAttributes(Map<String, Object> attributes) {
068                    String uuid = (String)attributes.get("uuid");
069    
070                    if (uuid != null) {
071                            setUuid(uuid);
072                    }
073    
074                    Long recordId = (Long)attributes.get("recordId");
075    
076                    if (recordId != null) {
077                            setRecordId(recordId);
078                    }
079    
080                    Long groupId = (Long)attributes.get("groupId");
081    
082                    if (groupId != null) {
083                            setGroupId(groupId);
084                    }
085    
086                    Long companyId = (Long)attributes.get("companyId");
087    
088                    if (companyId != null) {
089                            setCompanyId(companyId);
090                    }
091    
092                    Long userId = (Long)attributes.get("userId");
093    
094                    if (userId != null) {
095                            setUserId(userId);
096                    }
097    
098                    String userName = (String)attributes.get("userName");
099    
100                    if (userName != null) {
101                            setUserName(userName);
102                    }
103    
104                    Long versionUserId = (Long)attributes.get("versionUserId");
105    
106                    if (versionUserId != null) {
107                            setVersionUserId(versionUserId);
108                    }
109    
110                    String versionUserName = (String)attributes.get("versionUserName");
111    
112                    if (versionUserName != null) {
113                            setVersionUserName(versionUserName);
114                    }
115    
116                    Date createDate = (Date)attributes.get("createDate");
117    
118                    if (createDate != null) {
119                            setCreateDate(createDate);
120                    }
121    
122                    Date modifiedDate = (Date)attributes.get("modifiedDate");
123    
124                    if (modifiedDate != null) {
125                            setModifiedDate(modifiedDate);
126                    }
127    
128                    Long DDMStorageId = (Long)attributes.get("DDMStorageId");
129    
130                    if (DDMStorageId != null) {
131                            setDDMStorageId(DDMStorageId);
132                    }
133    
134                    Long recordSetId = (Long)attributes.get("recordSetId");
135    
136                    if (recordSetId != null) {
137                            setRecordSetId(recordSetId);
138                    }
139    
140                    String version = (String)attributes.get("version");
141    
142                    if (version != null) {
143                            setVersion(version);
144                    }
145    
146                    Integer displayIndex = (Integer)attributes.get("displayIndex");
147    
148                    if (displayIndex != null) {
149                            setDisplayIndex(displayIndex);
150                    }
151            }
152    
153            /**
154            * Returns the primary key of this d d l record.
155            *
156            * @return the primary key of this d d l record
157            */
158            public long getPrimaryKey() {
159                    return _ddlRecord.getPrimaryKey();
160            }
161    
162            /**
163            * Sets the primary key of this d d l record.
164            *
165            * @param primaryKey the primary key of this d d l record
166            */
167            public void setPrimaryKey(long primaryKey) {
168                    _ddlRecord.setPrimaryKey(primaryKey);
169            }
170    
171            /**
172            * Returns the uuid of this d d l record.
173            *
174            * @return the uuid of this d d l record
175            */
176            public java.lang.String getUuid() {
177                    return _ddlRecord.getUuid();
178            }
179    
180            /**
181            * Sets the uuid of this d d l record.
182            *
183            * @param uuid the uuid of this d d l record
184            */
185            public void setUuid(java.lang.String uuid) {
186                    _ddlRecord.setUuid(uuid);
187            }
188    
189            /**
190            * Returns the record ID of this d d l record.
191            *
192            * @return the record ID of this d d l record
193            */
194            public long getRecordId() {
195                    return _ddlRecord.getRecordId();
196            }
197    
198            /**
199            * Sets the record ID of this d d l record.
200            *
201            * @param recordId the record ID of this d d l record
202            */
203            public void setRecordId(long recordId) {
204                    _ddlRecord.setRecordId(recordId);
205            }
206    
207            /**
208            * Returns the group ID of this d d l record.
209            *
210            * @return the group ID of this d d l record
211            */
212            public long getGroupId() {
213                    return _ddlRecord.getGroupId();
214            }
215    
216            /**
217            * Sets the group ID of this d d l record.
218            *
219            * @param groupId the group ID of this d d l record
220            */
221            public void setGroupId(long groupId) {
222                    _ddlRecord.setGroupId(groupId);
223            }
224    
225            /**
226            * Returns the company ID of this d d l record.
227            *
228            * @return the company ID of this d d l record
229            */
230            public long getCompanyId() {
231                    return _ddlRecord.getCompanyId();
232            }
233    
234            /**
235            * Sets the company ID of this d d l record.
236            *
237            * @param companyId the company ID of this d d l record
238            */
239            public void setCompanyId(long companyId) {
240                    _ddlRecord.setCompanyId(companyId);
241            }
242    
243            /**
244            * Returns the user ID of this d d l record.
245            *
246            * @return the user ID of this d d l record
247            */
248            public long getUserId() {
249                    return _ddlRecord.getUserId();
250            }
251    
252            /**
253            * Sets the user ID of this d d l record.
254            *
255            * @param userId the user ID of this d d l record
256            */
257            public void setUserId(long userId) {
258                    _ddlRecord.setUserId(userId);
259            }
260    
261            /**
262            * Returns the user uuid of this d d l record.
263            *
264            * @return the user uuid of this d d l record
265            * @throws SystemException if a system exception occurred
266            */
267            public java.lang.String getUserUuid()
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    return _ddlRecord.getUserUuid();
270            }
271    
272            /**
273            * Sets the user uuid of this d d l record.
274            *
275            * @param userUuid the user uuid of this d d l record
276            */
277            public void setUserUuid(java.lang.String userUuid) {
278                    _ddlRecord.setUserUuid(userUuid);
279            }
280    
281            /**
282            * Returns the user name of this d d l record.
283            *
284            * @return the user name of this d d l record
285            */
286            public java.lang.String getUserName() {
287                    return _ddlRecord.getUserName();
288            }
289    
290            /**
291            * Sets the user name of this d d l record.
292            *
293            * @param userName the user name of this d d l record
294            */
295            public void setUserName(java.lang.String userName) {
296                    _ddlRecord.setUserName(userName);
297            }
298    
299            /**
300            * Returns the version user ID of this d d l record.
301            *
302            * @return the version user ID of this d d l record
303            */
304            public long getVersionUserId() {
305                    return _ddlRecord.getVersionUserId();
306            }
307    
308            /**
309            * Sets the version user ID of this d d l record.
310            *
311            * @param versionUserId the version user ID of this d d l record
312            */
313            public void setVersionUserId(long versionUserId) {
314                    _ddlRecord.setVersionUserId(versionUserId);
315            }
316    
317            /**
318            * Returns the version user uuid of this d d l record.
319            *
320            * @return the version user uuid of this d d l record
321            * @throws SystemException if a system exception occurred
322            */
323            public java.lang.String getVersionUserUuid()
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    return _ddlRecord.getVersionUserUuid();
326            }
327    
328            /**
329            * Sets the version user uuid of this d d l record.
330            *
331            * @param versionUserUuid the version user uuid of this d d l record
332            */
333            public void setVersionUserUuid(java.lang.String versionUserUuid) {
334                    _ddlRecord.setVersionUserUuid(versionUserUuid);
335            }
336    
337            /**
338            * Returns the version user name of this d d l record.
339            *
340            * @return the version user name of this d d l record
341            */
342            public java.lang.String getVersionUserName() {
343                    return _ddlRecord.getVersionUserName();
344            }
345    
346            /**
347            * Sets the version user name of this d d l record.
348            *
349            * @param versionUserName the version user name of this d d l record
350            */
351            public void setVersionUserName(java.lang.String versionUserName) {
352                    _ddlRecord.setVersionUserName(versionUserName);
353            }
354    
355            /**
356            * Returns the create date of this d d l record.
357            *
358            * @return the create date of this d d l record
359            */
360            public java.util.Date getCreateDate() {
361                    return _ddlRecord.getCreateDate();
362            }
363    
364            /**
365            * Sets the create date of this d d l record.
366            *
367            * @param createDate the create date of this d d l record
368            */
369            public void setCreateDate(java.util.Date createDate) {
370                    _ddlRecord.setCreateDate(createDate);
371            }
372    
373            /**
374            * Returns the modified date of this d d l record.
375            *
376            * @return the modified date of this d d l record
377            */
378            public java.util.Date getModifiedDate() {
379                    return _ddlRecord.getModifiedDate();
380            }
381    
382            /**
383            * Sets the modified date of this d d l record.
384            *
385            * @param modifiedDate the modified date of this d d l record
386            */
387            public void setModifiedDate(java.util.Date modifiedDate) {
388                    _ddlRecord.setModifiedDate(modifiedDate);
389            }
390    
391            /**
392            * Returns the d d m storage ID of this d d l record.
393            *
394            * @return the d d m storage ID of this d d l record
395            */
396            public long getDDMStorageId() {
397                    return _ddlRecord.getDDMStorageId();
398            }
399    
400            /**
401            * Sets the d d m storage ID of this d d l record.
402            *
403            * @param DDMStorageId the d d m storage ID of this d d l record
404            */
405            public void setDDMStorageId(long DDMStorageId) {
406                    _ddlRecord.setDDMStorageId(DDMStorageId);
407            }
408    
409            /**
410            * Returns the record set ID of this d d l record.
411            *
412            * @return the record set ID of this d d l record
413            */
414            public long getRecordSetId() {
415                    return _ddlRecord.getRecordSetId();
416            }
417    
418            /**
419            * Sets the record set ID of this d d l record.
420            *
421            * @param recordSetId the record set ID of this d d l record
422            */
423            public void setRecordSetId(long recordSetId) {
424                    _ddlRecord.setRecordSetId(recordSetId);
425            }
426    
427            /**
428            * Returns the version of this d d l record.
429            *
430            * @return the version of this d d l record
431            */
432            public java.lang.String getVersion() {
433                    return _ddlRecord.getVersion();
434            }
435    
436            /**
437            * Sets the version of this d d l record.
438            *
439            * @param version the version of this d d l record
440            */
441            public void setVersion(java.lang.String version) {
442                    _ddlRecord.setVersion(version);
443            }
444    
445            /**
446            * Returns the display index of this d d l record.
447            *
448            * @return the display index of this d d l record
449            */
450            public int getDisplayIndex() {
451                    return _ddlRecord.getDisplayIndex();
452            }
453    
454            /**
455            * Sets the display index of this d d l record.
456            *
457            * @param displayIndex the display index of this d d l record
458            */
459            public void setDisplayIndex(int displayIndex) {
460                    _ddlRecord.setDisplayIndex(displayIndex);
461            }
462    
463            public boolean isNew() {
464                    return _ddlRecord.isNew();
465            }
466    
467            public void setNew(boolean n) {
468                    _ddlRecord.setNew(n);
469            }
470    
471            public boolean isCachedModel() {
472                    return _ddlRecord.isCachedModel();
473            }
474    
475            public void setCachedModel(boolean cachedModel) {
476                    _ddlRecord.setCachedModel(cachedModel);
477            }
478    
479            public boolean isEscapedModel() {
480                    return _ddlRecord.isEscapedModel();
481            }
482    
483            public java.io.Serializable getPrimaryKeyObj() {
484                    return _ddlRecord.getPrimaryKeyObj();
485            }
486    
487            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
488                    _ddlRecord.setPrimaryKeyObj(primaryKeyObj);
489            }
490    
491            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
492                    return _ddlRecord.getExpandoBridge();
493            }
494    
495            public void setExpandoBridgeAttributes(
496                    com.liferay.portal.service.ServiceContext serviceContext) {
497                    _ddlRecord.setExpandoBridgeAttributes(serviceContext);
498            }
499    
500            @Override
501            public java.lang.Object clone() {
502                    return new DDLRecordWrapper((DDLRecord)_ddlRecord.clone());
503            }
504    
505            public int compareTo(
506                    com.liferay.portlet.dynamicdatalists.model.DDLRecord ddlRecord) {
507                    return _ddlRecord.compareTo(ddlRecord);
508            }
509    
510            @Override
511            public int hashCode() {
512                    return _ddlRecord.hashCode();
513            }
514    
515            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatalists.model.DDLRecord> toCacheModel() {
516                    return _ddlRecord.toCacheModel();
517            }
518    
519            public com.liferay.portlet.dynamicdatalists.model.DDLRecord toEscapedModel() {
520                    return new DDLRecordWrapper(_ddlRecord.toEscapedModel());
521            }
522    
523            public com.liferay.portlet.dynamicdatalists.model.DDLRecord toUnescapedModel() {
524                    return new DDLRecordWrapper(_ddlRecord.toUnescapedModel());
525            }
526    
527            @Override
528            public java.lang.String toString() {
529                    return _ddlRecord.toString();
530            }
531    
532            public java.lang.String toXmlString() {
533                    return _ddlRecord.toXmlString();
534            }
535    
536            public void persist()
537                    throws com.liferay.portal.kernel.exception.SystemException {
538                    _ddlRecord.persist();
539            }
540    
541            public com.liferay.portlet.dynamicdatamapping.storage.Field getField(
542                    java.lang.String fieldName)
543                    throws com.liferay.portal.kernel.exception.PortalException {
544                    return _ddlRecord.getField(fieldName);
545            }
546    
547            public java.io.Serializable getFieldDataType(java.lang.String fieldName)
548                    throws com.liferay.portal.kernel.exception.PortalException,
549                            com.liferay.portal.kernel.exception.SystemException {
550                    return _ddlRecord.getFieldDataType(fieldName);
551            }
552    
553            public com.liferay.portlet.dynamicdatamapping.storage.Fields getFields()
554                    throws com.liferay.portal.kernel.exception.PortalException {
555                    return _ddlRecord.getFields();
556            }
557    
558            public java.io.Serializable getFieldType(java.lang.String fieldName)
559                    throws java.lang.Exception {
560                    return _ddlRecord.getFieldType(fieldName);
561            }
562    
563            public java.io.Serializable getFieldValue(java.lang.String fieldName)
564                    throws com.liferay.portal.kernel.exception.PortalException {
565                    return _ddlRecord.getFieldValue(fieldName);
566            }
567    
568            public com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion getLatestRecordVersion()
569                    throws com.liferay.portal.kernel.exception.PortalException,
570                            com.liferay.portal.kernel.exception.SystemException {
571                    return _ddlRecord.getLatestRecordVersion();
572            }
573    
574            public com.liferay.portlet.dynamicdatalists.model.DDLRecordSet getRecordSet()
575                    throws com.liferay.portal.kernel.exception.PortalException,
576                            com.liferay.portal.kernel.exception.SystemException {
577                    return _ddlRecord.getRecordSet();
578            }
579    
580            public com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion getRecordVersion()
581                    throws com.liferay.portal.kernel.exception.PortalException,
582                            com.liferay.portal.kernel.exception.SystemException {
583                    return _ddlRecord.getRecordVersion();
584            }
585    
586            public com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion getRecordVersion(
587                    java.lang.String version)
588                    throws com.liferay.portal.kernel.exception.PortalException,
589                            com.liferay.portal.kernel.exception.SystemException {
590                    return _ddlRecord.getRecordVersion(version);
591            }
592    
593            public int getStatus()
594                    throws com.liferay.portal.kernel.exception.PortalException,
595                            com.liferay.portal.kernel.exception.SystemException {
596                    return _ddlRecord.getStatus();
597            }
598    
599            @Override
600            public boolean equals(Object obj) {
601                    if (this == obj) {
602                            return true;
603                    }
604    
605                    if (!(obj instanceof DDLRecordWrapper)) {
606                            return false;
607                    }
608    
609                    DDLRecordWrapper ddlRecordWrapper = (DDLRecordWrapper)obj;
610    
611                    if (Validator.equals(_ddlRecord, ddlRecordWrapper._ddlRecord)) {
612                            return true;
613                    }
614    
615                    return false;
616            }
617    
618            /**
619             * @deprecated Renamed to {@link #getWrappedModel}
620             */
621            public DDLRecord getWrappedDDLRecord() {
622                    return _ddlRecord;
623            }
624    
625            public DDLRecord getWrappedModel() {
626                    return _ddlRecord;
627            }
628    
629            public void resetOriginalValues() {
630                    _ddlRecord.resetOriginalValues();
631            }
632    
633            private DDLRecord _ddlRecord;
634    }