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