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